Form response backend date format
Hello,
I've created a Date Picker form widget based on this sitefinity tutorial. The user can only pick a day, not the time. It is working ok but I've noticed that there is an issue of how the date is displayed in the form response. The date time is 7 hours behind the selected day. See the attached image.
The selected date time is always MM DD YYYY 12:00 am, so when you see the date in the back end it is 17:00 the previous day. The Date is properly formatted in the code, and I'm assuming the date is entered into the way it is formatted in the code.
How do We fix this?
Thanks.
Have you tried .ToSitefinityUITime() on the dates themselves? (Its an extension in the "Telerik.Sitefinity" namespace)
Hi,
Sitefinity saves date-time formats in UTC and stores them this way in the database. As Steve suggests you need to use a ToLocalTime() or ToSitefinityUiTime() in order to convert it back to the proper for your respective time zone time.
Regards,
Pavel Benov
Telerik