note 30682 added to function.date

From: Date: Tue, 25 Mar 2003 16:43:47 +0000
Subject: note 30682 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-45805@lists.php.net to get a copy of this message
here's an update to the previous function: the right-comma-part of the win-timestamp must have 10 digits. It seem in some cases, that "0"s at the end are cut off (e.G. when generating such a time stamp by using ASP). Please modify the function as follows: function wT2uT($win_timestamp) { $WIN_DATE_CONST=2209165200; $WIN_TIME_CONST=115740.74074074; list($win_date, $win_time)=explode(",",$win_timestamp); $win_time=substr($win_time."0000000000",0,10); $ux_date = $win_date*24*60*60; $ux_date-= $WIN_DATE_CONST; $ux_time = round($win_time/$WIN_TIME_CONST); return($ux_date+$ux_time); } -- http://www.php.net/manual/en/function.date.php http://master.php.net/manage/user-notes.php?action=edit+30682 http://master.php.net/manage/user-notes.php?action=delete+30682 http://master.php.net/manage/user-notes.php?action=reject+30682

« previous php.notes (#45805) next »