4

I have a date-field where I get some raw data from another system (I have no control over the export of the other system) … the date is published in the following format:

2010-10-26T07:11:18Z

Is there a way to easily convert this format into a unix-timestamp/ee-compatible format?

I've tried {exp:query sql="SELECT UNIX_TIMESTAMP('col_id_22') AS unixtime FROM exp_matrix_data WHERE entry_id = {entry_id}"}{unixtime}{/exp:query} but this does not work (I guess because of the T and Z in the raw data?

  • Could you use Low Replace to format the date - using regex - into the correct format? – Jason Varga Nov 22 '12 at 14:06
  • Are you looking to use this on the front-end or back-end? – Derek Hogue Nov 22 '12 at 14:23
  • @DerekHogue: Well, we could change the format while importing (backend) or while displaying (Frontend). – albuvee Nov 22 '12 at 15:12
4

If displaying, one option could be to use the Nice Date plugin by low http://gotolow.com/addons/low-nice-date/docs which will displays date given a formatting.

  • Great! Didn't knew that plugin (and somehow oversaw on devot-ee). Thx Erwin! – albuvee Nov 22 '12 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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