I’ve built a site for a local funeral home that is entering a start date/time for individual services. I wrote a small plugin that allows them to select the duration then outputs the end time rather than having two date/time fields for them to enter. When they enter the start time and save it displays both in the CP and the website correctly. However, if they view the entry within preview, the dates are both off an hour. This is the same for all entries…not just the ones using the plugin to output an end time.
The forum won’t let me up upload files for some reason so here are links to the three screenshots:
You can see the date/time shows correctly in the first two but in the last (cp preview) it’s displaying an hour off.
Thank you!
Thanks for passing this along.
After taking a quick peek at it, I’d be inclined to say it’s related to the users time zone and daylight savings setting in the Control Panel. I’d recommend checking that to confirm they are set correctly.
I also just wanted to ask in passing if you took a peek at the Duration Fieldtype?
https://docs.expressionengine.com/latest/fieldtypes/duration.html
Hey Tom, thanks for your response! The date issue happens for all users, including mine however I do think you may be right. When I change my account timezone is currently set to America/Detroit, which is the same as the site…but when I preview it now shows the time as 5 hours off. It should be 2-4 on the sample I’m looking at but it’s displaying as 7-9 when I view in preview.
I have not used duration and didn’t realize it existed! I will test this and see how it works! Thank you for the suggestion!
Nick
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.