/[cvs]/nfo/php/libs/net.php.smarty/plugins/modifier.date_format.php
ViewVC logotype

Contents of /nfo/php/libs/net.php.smarty/plugins/modifier.date_format.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Wed Oct 9 00:53:36 2002 UTC (21 years, 9 months ago) by cvsjoko
Branch: MAIN
no message

1 <?php
2
3 /*
4 * Smarty plugin
5 * -------------------------------------------------------------
6 * Type: modifier
7 * Name: date_format
8 * Purpose: format datestamps via strftime
9 * Input: string: input date string
10 * format: strftime format for output
11 * default_date: default date if $string is empty
12 * -------------------------------------------------------------
13 */
14 require_once $this->_get_plugin_filepath('shared','make_timestamp');
15 function smarty_modifier_date_format($string, $format="%b %e, %Y", $default_date=null)
16 {
17 if($string != '') {
18 return strftime($format, smarty_make_timestamp($string));
19 } elseif (isset($default_date) && $default_date != '') {
20 return strftime($format, smarty_make_timestamp($default_date));
21 } else {
22 return;
23 }
24 }
25
26 /* vim: set expandtab: */
27
28 ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed