note 54072 added to function.date

From: Date: Thu, 23 Jun 2005 05:26:12 +0000
Subject: note 54072 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-90811@lists.php.net to get a copy of this message
For those of you non PHP 5 users but wants to have a similar functionality as 'c' option (ISO 8601 date), you can use my short snippets below: <? function get_iso_8601_date($int_date) { //$int_date: current date in UNIX timestamp $date_mod = date('Y-m-d\TH:i:s', $int_date); $pre_timezone = date('O', $int_date); $time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2); $date_mod .= $time_zone; return $date_mod; } echo get_iso_8601_date(time()); ?> ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54072 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54072&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54072&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54072&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54072&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54072&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54072&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54072&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#90811) next »