DST calculation wrong

Started by sdb, July 24, 2023, 03:02:33 PM

Previous topic - Next topic

sdb

I just read the following in https://www.photools.com/help/imatch/how-imatch-uses-date-and-time.htm:
QuoteIMatch uses date & time conversion routines which rely on a time zone database in order to tell if DST was active (locally) for a specific date. The results of the local time conversion hence take DST into account, shifting +1/ one hour, depending on the date portion of the timestamp and the date.

An excellent feature, if I understand it correctly  But I can't seem to get it to work.

I used as a test an image with all the metadata stripped out and a single date (1 March 2023) added to Exif:DateTimeOriginal.  No time offset is present.

I used the File.DateTime mapping mode 2 (the default).

My current Windows time zone is Europe/London (+01:00, because of DST).

I add the file to the database. VarToy shows:
File.DateTime.UTCOffset - +01:00
File.DateTime - 01/03/2023 12:00:00
File.DateTime.TZO - 01/03/2023 12:00:00+01:00
File.DateTime.Original - 01/03/2023 12:00:00
File.DateTime.UTC - 01/03/2023 11:00:00
File.DateTime.UTC.TZO - 01/03/2023 11:00:00Z
File.DateTime.Local - 01/03/2023 11:00:00
File.DateTime.Local.TZO - 01/03/2023 11:00:00+01:00
File.MD.XMP::photoshop\DateCreated\DateCreated\0 - 2023:03:01 12:00:00+01:00
File.MD.XMP::xmp\CreateDate\CreateDate\0 - 2023:03:01 12:00:00+01:00

The conversion routine should have determined that DST was not active (locally) for the specific date of 1 March 2023, but instead it used the current TZO, including DST.

Have I misunderstood something?

Mario

I have resolved this issue for the next update.
Under some condition, the current local time zone was applied to the FW attribute and the corresponding variable, without taking the DST setting at the date into account.

An image with an UTC timestamp of 12:00:00 should show in the German time zone (UTC+01:00):

a) when taken in March: 13:00:00+01:00
b) when taken in July: 14:00:00+02:00

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sdb


Mario

Thanks for reporting the problem.
Bugs I can reproduce, I can fix (usually) quickly.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook