Convert UTC String ("Sat, 05 Oct 2019 22:06:59 UTC") to Clarion LONG date and time

Does SV or StringTheory have a way to Convert UTC String (“Sat, 05 Oct 2019 22:06:59 UTC”) to Clarion LONG date and time values?

Check StringTheory’s StringDeformat stuff
https://www.capesoft.com/docs/StringTheory3/StringTheory.htm#ExtendedPictures

If you have any of our products then the core base class contains a method specifically for this.

Try the TemplateHelper “CalcClarionDateFromUTC” and “CalcClarionTimeFromUTC” methods.

Regards,

Andy
noyantis.com

I did a positional extraction of the date and time strings and deformatted them with @d08 and @t04 . Now, I need to get the user’s TimeZone offset and apply that after converting the Clarion Date & Time to Unix Epoc with StringTheory’s ClarionToUnixDate().

Create a SYSTEMTIME the Group is defined in CwUtil.clw or one of the SV*.inc files. It’s easy because all the D/M/Y H:M:S parts are variables in the group so no need for Clarion Date or Time.

Call SystemTimeToTzSpecificLocalTime ( , InUtcSysTime, OutLocalSysTime) omitting the TZ for local TZ.

BOOL SystemTimeToTzSpecificLocalTime(
  [in, optional] const TIME_ZONE_INFORMATION *lpTimeZoneInformation,
  [in]           const SYSTEMTIME            *lpUniversalTime,
  [out]          LPSYSTEMTIME                lpLocalTime
);

typedef struct _SYSTEMTIME {
  WORD wYear;
  WORD wMonth;
  WORD wDayOfWeek;
  WORD wDay;
  WORD wHour;
  WORD wMinute;
  WORD wSecond;
  WORD wMilliseconds;
} SYSTEMTIME, 

There are ways that use a FILE TIME that seen harder.

Okay, thanks Carl.
BTW, Do you know if this function, or any built-in Windows date/time API, knows how to convert to local time using the daylight savings time bias that was active on that particular date/time? Or, is it up to the caller of the function(s) to figure out if standard or DST was active on the date being converted and then pass appropriate values in the optional lpTimeZoneInformation parameter?

Off the top of my head I don’t know, but I gave you the link to the MSDN page for that function that if you read it you would see in Remarks:

Remarks

The SystemTimeToTzSpecificLocalTime function takes into account whether daylight saving time (DST) is in effect for the local time to which the system time is to be converted.

MSDN tends to be well documented. That also has a good See Also section with links to all the Time functions:

I see the TIME_ZONE_INFORMATION structure has discussion of how DST is usedas does the newer DYNAMIC_TIME_ZONE_INFORMATION