[pmwiki-devel] Help with PHP Dates

Patrick R. Michaud pmichaud at pobox.com
Sun Jan 4 18:58:39 CST 2009


On Fri, Jan 02, 2009 at 05:53:55PM -0500, DaveG wrote:
> 3] I initially thought to store using the Unix format. However, 
> {(ftime)} doesn't appear to work when fed Unix timestamps. 

Try placing an '@' in front of the Unix timestamp:

    {(ftime @1231116927)}

    January 04, 2009, at 06:55 PM 


> 4] Sounds like it should be easy to use {(ftime)}, but I'm not able to 
> get a full time back using the default $TimeFmt ('%B %d, %Y, at %I:%M 
> %p'). So:
> input: {(ftime fmt="%B %d, %Y, at %I:%M %p" when="2009-01-22 16:01:00")}
> output: "January 22, 2009, at 12:00 AM"

The ISO format wants a 'T' in front of the time:

  input: {(ftime fmt="%B %d, %Y, at %I:%M %p" when="2009-01-22T16:01:00")}
  output: "January 22, 2009, at 04:01 PM"

Pm



More information about the pmwiki-devel mailing list