note 38911 added to function.strtotime

From: Date: Sun, 11 Jan 2004 22:59:55 +0000
Subject: note 38911 added to function.strtotime
Groups: php.notes 
Request: Send a blank email to php-notes+get-63329@lists.php.net to get a copy of this message
Do you know SimpleDateFormat from Java? I was missing this class a lot, so I wrote a PHP version: include_once 'SimpleDateFormat.php'; $input_format = new SimpleDateFormat('dd.MM.yyyy HH:mm:ss'); //Europe standard $output_format = new SimpleDateFormat('yyyy-MM-dd HH:mm:ss'); //mySql standard $input_date = '29.2.2000 14:33:57'; $date = $input_format->parse($input_date); if ($date != ""){ //date is valid $output_date = $output_format->format($date); } else { //date is invalid } For more see http://www.siarsky.ch/php/SimpleDateFormat.html ---- Manual Page -- http://www.php.net/manual/en/function.strtotime.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38911 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38911&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38911&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#63329) next »