For more information... RTFM!
NAVIGATION
RECENTLY VIEWED
PAGES THAT LINK HERE
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

strftime

Format a UNIX time value, measured as the number of seconds since the Epoch (1970-01-01 00:00:00 UTC).  into a human-readable date and time string, according to the specified format.

The parameter is expected to be a date/time specification, using the

POSIX strftime Link to an external page tokens listed here.  The default is "%a %b %d %H:%M:%S %Y".

Also see the convert_date filter.

Example

[filter strftime.%d.%B.%Y.%H:%M:%S.%Z]1171598662[/filter]

Results in:

16 February 2007 04:04:22 GMT

Source code

sub {
    my $time = shift(@_);

    shift(@_);
    my $fmt = shift(@_);
    while(my $add = shift(@_)) {
        $fmt .= " $add";
    }

    if($fmt) {
        return POSIX::strftime($fmt, localtime($time));
    }
    else {
        return scalar localtime($time);
    }
}

Category:  Filters
Last modified by: Kevin Walsh
Modification date: Monday 26 February 2007 at 12:03 PM (EST)
Home  |  Legal nonsense  |  Privacy policy  |  Contact us