Windows doesn't get the full date & time for the System.GPS.Date property

David Lowndes 4,711 Reputation points
2021-09-26T23:37:34.687+00:00

I've recently noticed one of my applications wasn't showing the correct date & time for the System.GPS.Date property (PKEY_GPS_Date) for photos (.jpg) that have GPSDateStamp & GPSTimeStamp EXIF properties. I've verified the files do have correct EXIF metadata by using 3'rd party tools such as Exiftool and IrfanView.

For example, where Exiftool shows a file as having:

GPS Date/Time : 2021:03:27 14:51:35Z
GPS Date Stamp : 2021:03:27
GPS Time Stamp : 14:51:35

Using the Windows property system to get System.GPS.Date returns a FILETIME for 27/03/2021 12:00:00 (UK format date)

On examining other files that have GPS date & time properties, the date is correct, but the time I see is either 12:00:00 or 13:00:00 dependent on whether the date is in the DST period or not; I guess the time may vary depending on your locale.

The relevant code portion (sans error checking) to get the value is quite simple, so I don't see that it could be wrong (and the same code is fine for for other property system date/time properties):

CComPtr<IPropertyStore> ReadStore;  
SHGetPropertyStoreFromParsingName( pszFilePath, nullptr, GPS_DEFAULT | GPS_BESTEFFORT, IID_PPV_ARGS( &ReadStore ) );  

CPropVariant value;  
ReadStore->GetValue( PKEY_GPS_Date, &value );  

Although the property name System.GPS.Date only mentions "date", its documentation does say date and time.

It would appear from my limited testing that this issue has existed since at least Windows 7.
I've searched for anyone else noticing this, but can't find any mention of it so far.

I'd be interested to know if anyone else can reproduce this, and to hear if MS regards this as a deficiency, or whether there's a good reason for this odd behaviour.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,632 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Minxin Yu 10,946 Reputation points Microsoft Vendor
    2021-09-27T06:31:24.027+00:00

    Hi,

    The DateTime described in the document System.GPS.Date provides little information and is really easy to misunderstand. You could report the problem on Developer Community.

    Best regards,

    Minxin Yu


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.