date format
-
I’m trying to format the attachment date, but the two formatting options I’ve tried aren’t working. What am I missing?
My Syntax:
[+date,date(‘F j, Y’)+]Tried ,timestamp and ,date.
,timestamp(f) Many date and time values such as [+meta:image_meta.created_timestamp+] are stored as a UNIX timestamp. The “,timestamp” format converts a timestamp into a variety of date and/or time string formats, using the PHP date() function. Details on the format_string argument can be found at: http://php.net/manual/en/function.date.php.
The default format string is “d/m/Y H:i:s”, e.g., “31/12/2014 23:59:00” (just before midnight on new year’s eve). You could code [+meta:image_meta.created_timestamp,timestamp(‘j F, Y’)+] to display “31 December, 2014”.
,date(f) Many EXIF date and time values such as DateTimeOriginal and DateTimeDigitized are stored as strings with a format of “YYYY:MM:DD HH:MM:SS”. You can parse this format and just about any English textual datetime description into a Unix timestamp, then format the result by using the “,date” format. This format first uses the PHP strtotime() function, then the date() function. The “Supported Date and Time Formats” can be found at: http://php.net/manual/en/datetime.formats.php.The default format string is “d/m/Y H:i:s”, e.g., “31/12/2014 23:59:00” (just before midnight on new year’s eve). You could code [+exif:DateTimeOriginal,date(‘j F, Y’)+] to display “31 December, 2014”.
The topic ‘date format’ is closed to new replies.