I have an imagefield, 'event_image' and printing all possible
variables for the field tells me I have timestamp as a possible variable
of the image to render. I use:
... in node--mycustom.tpl.php to get the variables. Now I can render the timestamp as such:
... and it prints a UNIX formatted timestamp as:
I'd like to convert this to a PHP date format. So I am guessing I
would need to convert the UNIX timestamp somehow using the PHP gmdate function. Typically I would use something like this for raw php:
Which would take my timestamp and output:
... but I just don't know how to do within the context of my drupal 7 field and the node template. |
Friday, 26 June 2015
Converting a timestamp to PHP date format for a field in a node template
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment