Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Timestamp issue - 4 hours being added when saved
Fri, Oct 28 2016 5:23 PMPermanent Link

Trinione

Hi:
Saving the Now value adds exactly 4 hours to the saved time in a TimeStamp field. For example:

------------------------------------------
dtTme := Now;    // time as 2016-10-28 17:15:02... (5:15 PM)
ds.Columns['theDateTime'].AsDateTime := dtTme;   // this saves the time as 2016-10-28 21:15:02... (9:15 PM)
------------------------------------------

Note: Setting the field as Generated with 'Generate As Expression' to 'CURRENT_TIMESTAMP' results in the correct time being saved.

Is this a bug when saving a TimeStamp field type from EWB to EDB?
Sat, Oct 29 2016 4:57 AMPermanent Link

Walter Matte

Tactical Business Corporation

No Bug - Localization - Time Zone.

Walter


Trinione wrote:

Hi:
Saving the Now value adds exactly 4 hours to the saved time in a TimeStamp field. For example:

------------------------------------------
dtTme := Now;    // time as 2016-10-28 17:15:02... (5:15 PM)
ds.Columns['theDateTime'].AsDateTime := dtTme;   // this saves the time as 2016-10-28 21:15:02... (9:15 PM)
------------------------------------------

Note: Setting the field as Generated with 'Generate As Expression' to 'CURRENT_TIMESTAMP' results in the correct time being saved.

Is this a bug when saving a TimeStamp field type from EWB to EDB?
Sat, Oct 29 2016 5:25 AMPermanent Link

Trinione

Walter Matte wrote:
<< No Bug - Localization - Time Zone.>>


How is this addressed though?
Sat, Oct 29 2016 1:12 PMPermanent Link

Raul

Team Elevate Team Elevate

On 10/29/2016 5:25 AM, Trinione wrote:
>
> How is this addressed though?
>

EWB (javascript) works in UTC so you'd need to take that into account
when displaying in general.

Similarly on EDB side use CURRENT_TIMESTAMP(UTC) for EDB to default UTC
timestamp vs local.

Raul
Sat, Oct 29 2016 3:35 PMPermanent Link

Trinione

So, how can the value of Now be converted to seconds since that 1970 date so it will be accepted by EDB properly?
Sun, Oct 30 2016 6:50 AMPermanent Link

Walter Matte

Tactical Business Corporation

function NowLocal : DateTime;
begin
 result := Now - (TimeZoneOffSet(now) * 60 * 1000);
end;
Sun, Oct 30 2016 11:43 AMPermanent Link

Trinione

Walter:
Thank you very much, that works perfectly.
Tue, Nov 1 2016 3:31 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< Saving the Now value adds exactly 4 hours to the saved time in a TimeStamp field. For example: >>

If you're using the EWB Web Server with the dataset support, make sure that the....damn, I just realized something - in the switch to the new database design in EWB, I forgot to add the LocalizeDateTimeColumns option back in for the datasets.  That option is the option that you can use to specify that you want dates/times localized/converted to UTC when the EWB web server reads from or writes to the dataset on the back-end.

I'll need to add this back in as part of the new build I'm doing this week.

Tim Young
Elevate Software
www.elevatesoft.com
Image