I use the module "Automatic Nodetitles" to use a date-field as node title (via token). But the provided token uses the full format of the date/time, so i want to short that. How can i do that? Can i use a token with a formatter? Or do i have to execute PHP?
Any suggestions?

Comments

rj’s picture

I *think* you'll need to use the unix timestamp token and then use date() to format.

--rj

adam1’s picture

As far as i can say after one day research, try, and error: it is not possible to use tokens in PHP-code, instead you have to execute php-code like this:
print date('j\.m\.Y\-G\h\-', $node->field_mydatefield['und'][0]['value'])
Attention:
$node->field_mydatefield[$node->language][0]['value']
does not work, you have to set language to 'und' (undefined) – maybe that's a bug ...?