note 83429 deleted from function.date by googleguy
| From: | googleguy@php.net | Date: | Sat, 12 Jan 2013 09:27:23 +0000 |
| Subject: | note 83429 deleted from function.date by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192954@lists.php.net to get a copy of this message | ||
Note Submitter: phil dot taylor at enilsson dot com
----
Found this helpful when converting unix dates for use with the ical file format.
<?php
// Converts a unix timestamp to iCal format (UTC) - if no timezone is
// specified then it presumes the uStamp is already in UTC format.
// tzone must be in decimal such as 1hr 45mins would be 1.75, behind
// times should be represented as negative decimals 10hours behind
// would be -10
function unixToiCal($uStamp = 0, $tzone = 0.0) {
$uStampUTC = $uStamp + ($tzone * 3600);
$stamp = date("Ymd\THis\Z", $uStampUTC);
return $stamp;
}
?>