2

I've having an issue where a Date/Time field (time only) is outputting the time in the front-end template with an extra 10 minutes.

In my template I'm using entry.startTime|date("g:ma”).

In the DB the field_startTime for the entry is 2016-10-15 16:00:00, but on the front-end I’m seeing 4:10pm.

Could anyone tell me where are these extra 10 minutes coming from, please?

This is happening both locally and on the dev server, using Craft CMS 2.6.2949

6

You are using the wrong variables.

The 10 is there because it means October not 10 minutes.

You have to use | date("g:ia”).

| improve this answer | |

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.