Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Problem with dates saved in database
Sun, Mar 11 2018 7:27 PMPermanent Link

Paul Coshott

Avatar

Hi All,

I am using EWB with ElevateDB. I am saving a record with a field StartDate, and whatever date I set the TDateEditComboBox to, the database saves the previous days date.

I think this may have something to do with different time zones. I am in Western Australia and we are GMT +8 hours. I was doing the testing about 6am, so I think that's why it was happening.

I am not using the edits data bound, I am loading the dataset, and then manually loading the edits. Then when I save, I am manually building the record, before saving.

Can anyone tell me how to handle local dates and times so this doesn't happen.

Thanks,
Paul
Mon, Mar 12 2018 1:28 AMPermanent Link

Frederick Chin

Paul Coshott wrote:

/*
Can anyone tell me how to handle local dates and times so this doesn't happen.
*/

You need to check the Localize Date/Time Columns for the dataset in the Database Manager and set the property LocaliseDateTimeColumns to True for the TDataSet if you drop it onto a TDatabase.

--
Frederick
Mon, Mar 12 2018 5:14 AMPermanent Link

Paul Coshott

Avatar

Frederick Chin wrote:

>>You need to check the Localize Date/Time Columns for the dataset in the Database Manager and set the property >>LocaliseDateTimeColumns to True for the TDataSet if you drop it onto a TDatabase.

Hi Frederick,

Thanks. I had tried that, but it didn't work. I tried again, but this time I set every dataset in the Database Manager to true and every dataset on my forms to true and it worked. Thanks so much for the help.

Cheers,
Paul
Mon, Mar 12 2018 10:26 AMPermanent Link

Frederick Chin

Hi Paul,

/*
Thanks. I had tried that, but it didn't work. I tried again, but this time I set every dataset in the Database Manager to true and every dataset on my forms to true and it worked. Thanks so much for the help.
*/

You are welcome.

I had the same issue and I was able to solve it with help from this forum as well.

--
Frederick
Image