Check if a date value was in DST or not?
Posted: Mon Feb 19, 2018 10:06 pm
Hi,
E.g. DirectoryEntryDate(hDir, #PB_Date_Modified) gets the date for a file / folder
without correcting it when the file / folder was created during the DaylightSaving time
(first sunday in april through the last sunday in october) so this date is one hour off.
Is it possible to check if such a date is in the range of DST for that year so that I could
add one hour to the date read by DirectoryEntryDate(hDir, #PB_Date_Modified) or GetFileDate()?
E.g.
E.g. DirectoryEntryDate(hDir, #PB_Date_Modified) gets the date for a file / folder
without correcting it when the file / folder was created during the DaylightSaving time
(first sunday in april through the last sunday in october) so this date is one hour off.
Is it possible to check if such a date is in the range of DST for that year so that I could
add one hour to the date read by DirectoryEntryDate(hDir, #PB_Date_Modified) or GetFileDate()?
E.g.
Code: Select all
file name:_Serialized Data.txt | last modified date: 17.04.2016 13:26:24 | PB date: 1460899584
Code: Select all
Procedure.b IsDateInDayLightSavingTime(date)
Protected.b result = #False
; Pseudocode
If date >= DaylightDate for 2016 and date <= StandardDate for 2016
result = #True
EndIf
ProcedureReturn result
EndProcedure
Code: Select all
Debug IsDateInDayLightSavingTime(1460899584)
Output: 1