Procedural File: modifier.date_format.php

Source Location: /bblog/bBlog_plugins/modifier.date_format.php ( Revision Log )

Page Details

modifier.date_format.php - smarty modifier to format a timestamp

License:  GNU General Public License
Copyright:  The bBlog Project, http://www.bblog.com/
Version:  $Id: $
Author:  Kenneth Power - <kenneth.power@gmail.com> - last modified by $LastChangedBy: $
Functions
bblog_modifier_date_format_help  [line 158]

void bblog_modifier_date_format_help( )


[ Top ]
identify_modifier_date_format  [line 145]

void identify_modifier_date_format( )


[ Top ]
smarty_modifier_date_format  [line 66]

string smarty_modifier_date_format( integer $date, [string $format = "%F %j, %Y, %g:%i %a"]  )

Modified a timestamp according to one of several definitions

Uses the PHP strftime() and date() functions

The formats available are: <dl> <dt>full</dt> <dd>Format as: Weekday, day. Month Year, Hour:Minute. <strong>Example</strong>: Wednesday, 03. August 2005, 14:05 </dd> <dt>date</dt> <dd>Format as Wednesday, 03 August 2005</dd> <dt>europe</dt> <dd>Format as 03.08.2005</dd> <dt>shortdate</dt> <dd>Preferred date representation for the current locale without the time </dd> <dt>month</dt> <dd>Format as: August</dd> <dt>year</dt> <dd>Format as: 2005</dd> <dt>monthyear</dt> <dd>Format as: August 2005</dd> <dt>time</dt> <dd>Format as: 14:05</dd> <dt>12hour</dt> <dd>Format as: 2:05 PM</dd> <dt>s1</dt> <dd>Format as: August 3, 2005, 2:05 pm</dd> <dt>s2</dt> <dd>Format as: August 3, 2005</dd> <dt>atom</dt> <dd>Format as: 2005-08-03EST 14:05:13 -18000</dd> <dt>rss20</dt> <dd>Format as: Wed, 03 Aug 2005 14:05:13 EST</dd> <dt>rss92</dt> <dd>Same as rss20</dd> <dt>suffix</dt> <dd>Provide the English ordinal suffix for the day of the month, 2 characters. <em>st</em>, <em>nd</em>, <em>rd</em> or <em>th</em> </dd> <dt>ISO8601</dt> <dd>Format as: 2005-08-03T14:13:13-05:00</dd> <dt>elapsed</dt> <dd>Displays the year(s), month(s), day(s), hour(s), minute(s) and second(s) between $date and now</dd> <dt>default</dt> <dd></dd> </dl>

Parameters:
integer   $date:  The time stamp to modify
string   $format:  The format requested


[ Top ]
time_diff  [line 228]

string time_diff( integer $from, integer $to  )

Calculate the difference between two time stamps

Given two time stamps, this function calculates the difference in to the second between the two. If only one timestamp is given the difference is calculated between it and the current time. The first parameter is supposed to be the older of the two timestamps. In the case where it isn't, we transpose the two arguments.

Parameters:
integer   $from:  The older of the two timestamps
integer   $to:  The younger of the timestamps. If not specified, defaults to the current time


[ Top ]