photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: busbahnhof on March 18, 2021, 01:37:50 PM

Title: DateTime format in file windows
Post by: busbahnhof on March 18, 2021, 01:37:50 PM
Per default the header 2 left shows "Datum & Zeit (kurzes Format)" (sorry, I don't know the translation in the English software version), like this: 19.05.2009 15:58  --> as far as I learned: CreateDate + Offset

But what I want to see is the UTC time. So I use "Erstellungsdatum", it shows 2009:05:19 14:58:57+00:00  --> without offset

I tried to get a better format with {File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:DD.MM.YYYY hh:mm:ss}. So it shows 19.05.2009 14:58:57. But I haven't found anything in the IM help to show the +00:00. What do I have to do in this case?
Title: Re: DateTime format in file windows
Post by: Mario on March 18, 2021, 01:58:18 PM
You could use {File.MD.XMP::photoshop\DateCreated\DateCreated|value:rawfrm} to get the date and time directly from the raw metadata (with or without time zone information, depending on whats in the file).
Metadata Variables: Formatted and Raw (https://www.photools.com/help/imatch/#var_basics.htm?dl=h-183)
Title: Re: DateTime format in file windows
Post by: busbahnhof on March 18, 2021, 02:02:46 PM
Yes, this works. But then the format is again 2009:05:19 14:58:57+00:00.

I was just looking for a different way to show the date like   19.05.2009  . But if that is not possible together with showing the time zone, it is OK. I just want to be sure I didn't miss anything.
Title: Re: DateTime format in file windows
Post by: Mario on March 18, 2021, 02:03:47 PM
If you need to do such a thing, use one variable for formatting the date as you did, and another with substr to extract only the time-zone portion from the raw tag? This is easy to do.
Title: Re: DateTime format in file windows
Post by: busbahnhof on March 18, 2021, 02:19:42 PM
Coding is kind of fun :-)

The time zone +00:00 is now shown correctly, but hh:mm:ss still adds one hour offset to the UTC time.
Title: Re: DateTime format in file windows
Post by: busbahnhof on March 18, 2021, 02:37:12 PM
I will close this one. substrr is a nice function, but it is a bad solution in this case. If the {File.MD.XMP::photoshop\DateCreated\DateCreated\0} contains a time zone information like "+00:00", everything is good. But if it doesn't contain time zone information, it looks just weird (24.10.2020 09:53:48:48.89). Maybe I can code some lines to insert some if-clauses or whatever. But I will continue working with pictures and not code ;-)

Thanks anyway for your time! Your support is very appreciated!