Using, for instance, {current_time} you get the time according to your server timezone setting. I see I can format it with {current_time format="{DATE_COOKIE}"} to get a result in UTC, but I need it in another format than cookie.

I know I can write a plugin or some direct PHP to pull it out, but is there anything within what EE gives us to return the UTC time?

up vote 0 down vote accepted

You can apply your own custom format if you need something specific.

You can find details on how to do it in the docs here:

Date Variable Formatting

If you need to do something more specialised you could maybe try Low Nice Date that allow you to localise the date.

  • I'm familiar with this, but the way I'm reading it, {current_time} will always return time in the server's time (e.g. UTC-05 for Eastern Standard Time). But to get time in UTC, there isn't anything there, is there? – Tim FitzGerald Aug 5 '13 at 14:12
  • You are right, sorry, I read you question as a formatting issue. If you need to localise the date to the viewer you could try the add-on I've added to my answer, it might be of use. – Steve Holland Aug 5 '13 at 14:44

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.