cvs: pearweb /include pear-format-html.php

From: Date: Wed, 07 Jul 2004 22:28:57 +0000
Subject: cvs: pearweb /include pear-format-html.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-432@lists.php.net to get a copy of this message
danielc Wed Jul 7 18:28:57 2004 EDT Modified files: /pearweb/include pear-format-html.php Log: * Add make_utc_date(). http://cvs.php.net/diff.php/pearweb/include/pear-format-html.php?r1=1.128&r2=1.129&ty=u Index: pearweb/include/pear-format-html.php diff -u pearweb/include/pear-format-html.php:1.128 pearweb/include/pear-format-html.php:1.129 --- pearweb/include/pear-format-html.php:1.128 Mon Jul 5 16:18:11 2004 +++ pearweb/include/pear-format-html.php Wed Jul 7 18:28:57 2004 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ | Authors: | +----------------------------------------------------------------------+ - $Id: pear-format-html.php,v 1.128 2004/07/05 20:18:11 danielc Exp $ + $Id: pear-format-html.php,v 1.129 2004/07/07 22:28:57 danielc Exp $ */ PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'error_handler'); @@ -886,6 +886,22 @@ function hdelim() { return '<hr />'; +} + +/** + * Converts a Unix timestamp to a date() formatted string in the UTC time zone + * + * @param int $ts a Unix timestamp from the local machine. If none + * is provided the current time is used. + * @param string $format a format string, as per http://php.net/date + * + * @return string the time formatted time + */ +function make_utc_date($ts = null, $format = 'Y-m-d H:i \U\T\C') { + if (!$ts) { + $ts = time(); + } + return date($format, $ts - date('Z', $ts)); } ?>

« previous php.pear.core (#432) next »