note 30669 added to function.date

From: Date: Tue, 25 Mar 2003 13:29:19 +0000
Subject: note 30669 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-45792@lists.php.net to get a copy of this message
Did you ever wonder how to convert a windows timestamp into a unix timestamp? E.g. a timestamp generated by an ASP-Script, VisualBasic or whatever. This function works pretty well for me: function wT2uT($win_timestamp) { $WIN_DATE_CONST=2209165200; $WIN_TIME_CONST=115740.74074074; list($win_date, $win_time)=explode(",",$win_timestamp); $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); } EXAMPLE: $win_ts="37705,9798611111"; print date("d.m.Y H:i:s", wT2uT($win_ts); should result into this output: 25.03.2003 23:31 ATTENTION: Using this function you probably will run into trouble with Summer- and Wintertime. You will have to convert Summer into Wintertime (and vice versa) manually! -- http://www.php.net/manual/en/function.date.php http://master.php.net/manage/user-notes.php?action=edit+30669 http://master.php.net/manage/user-notes.php?action=delete+30669 http://master.php.net/manage/user-notes.php?action=reject+30669

« previous php.notes (#45792) next »