More in this section

Forums / Developing with Sitefinity / Form response backend date format

Form response backend date format

3 posts, 0 answered
  1. Jonathan
    Jonathan avatar
    9 posts
    09 Apr 2013
    03 Jul 2014
    Link to this post


    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? 


  2. Steve
    Steve avatar
    3037 posts
    03 Dec 2008
    03 Jul 2014 in reply to Jonathan
    Link to this post

    Have you tried .ToSitefinityUITime() on the dates themselves? (Its an extension in the "Telerik.Sitefinity" namespace)

  3. Pavel Benov
    Pavel Benov avatar
    341 posts
    14 Mar 2016
    08 Jul 2014
    Link to this post

    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.

    Pavel Benov
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
3 posts, 0 answered