Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Using tokens the date parts are not extracted as expected:
token: Result:
timestamp | Thu, 01/05/2008 - 00:00
yeartoken yyyy | Thu, 01/05/2008 - 00:00
yeartoken yy | Thu, 01/05/2008 - 00:00
month month | Thu, 01/05/2008 - 00:00
month abrv | Thu, 01/05/2008 - 00:00
month mm | Thu, 01/05/2008 - 00:00
This is because in date.token.inc the function date_format_date is called without the $type-parameter set properly ('custom').
In this case the $format parameter will be send to the $type parameter and the date will not be formatted.
After changing the lines from 50 and on from:
$tokens['timestamp'] = date_format_date($date, 'U');
to
$tokens['timestamp'] = date_format_date($date, 'custom', 'U');
tokens works OK.
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedThis was fixed a while back in the -dev version.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.