ulisses
ulisses

Reputation: 1581

Why the Info change the createdDateTime Table's field?

I have to stamp with info a createdDateTime field's Table,

I used this simple code:

info( strfmt("Date-Time: %1" , myTableDate.createdDateTime)  );

On myTableDate I have this value: 05/08/2015 12:48:57

On video in info I see this message:

Date-time: 05/08/2015 10:48:57

I see two hours less than the value stored in table. The field createdDateTime is the standard table's field .

Thanks all,

enjoy!

Upvotes: 1

Views: 461

Answers (2)

Neti
Neti

Reputation: 1

You need correct a timeZone^ DateTimeUtil::getUserPreferredTimeZone()

Upvotes: 0

Jan B. Kjeldsen
Jan B. Kjeldsen

Reputation: 18051

You will have to correct for timezone, as strFmt will not do it for you:

info( strfmt("Date-Time: %1", DateTimeUtil::applyTimeZoneOffset(myTableDate.createdDateTime, DateTimeUtil::getUserPreferredTimeZone()));

Upvotes: 2

Related Questions