2 Replies Latest reply on Apr 11, 2011 11:24 AM by lumpy61

    date stored in database one less than date entered in form

    lumpy61

      We have an application which uses

      the datefield object. We capture a date via a form and write it to the d

      atabase.

      When i check the database the date written appears to be 1 day less than what I entered.

      When i pull that record up on the screen, it appears to be correct again.

       

      Now later in my app I reference this datefield object again in a and this time it brings back the date as stored in the database ... i.e. one day less than what I entered.

      Anyone else had this?

      What are we doing wrong here?

      Thanks

      Eric

        • 1. Re: date stored in database one less than date entered in form
          tooMuchTrouble Level 3

          On 4/12/2011 12:00 AM, lumpy61 said:

           

          When i check the database the date written appears to be 1 day less than what I entered.

          When i pull that record up on the screen, it appears to be correct again.

           

          server & client are in different timezones & your app has fallen into timezone

          hell. might try using epoch offsets (java or unix if ms accuracy isn't required)

          instead of date objects.

          • 2. Re: date stored in database one less than date entered in form
            lumpy61 Level 1

            Interesting idea ...

            I also note that all the records in the database have a timestamp of 21:00:00 on them. I am on the US east coast and the server may be on the west coast.

            But even if that's true, how would the client know to add back the 1 day when it pulls the record back up?

            Surely that implies that the flex object has some logic built into it alredy to fiddle with these dates?

            Is there some way to change the default time being used to write these records ? perhaps that will clear up the issue - i.e. say if we write with a time of 00:00:00 instead of 21:00:00 ...?

             

            As you can tell, I'm clueless here.

            Thanks

            Eric