LiveWhale CMS

Welcome, Guest Login

Support Center

Our documentation is moving: docs.livewhale.com

Please check docs.livewhale.com for the most up-to-date LiveWhale CMS and LiveWhale Calendar documentation. The below legacy documentation will remain available as a reference until the documentation migration is complete.

Working with Event Times

Last Updated: Jun 25, 2014 02:50PM PDT
Beginning with LiveWhale 1.5, all event start and end times are saved to the database in UTC, as LiveWhale is now timezone and daylight-savings aware. This means that if you’re thinking of building a custom events widget, or working with event times in general, you may need to convert them to local time.

LiveWhale has a convenience method that can help you. Assuming you have $date_dt and $timezone from the event, and $date_dt2 if there’s an end date, here’s how you can convert it to a local time string:
$_LW->toDate('m/d/Y', $_LW->toTS($date_dt, 'UTC'), $timezone);
Replace the m/d/Y format with any suitable PHP date() format string as needed; the LiveWhale method passes your format to date() after making the transition to local (or $timezone) time.
 
eb8f96c071020d8b0923da726d6cab65@livewhale.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete?b_id=4256