hs-hourglass icon indicating copy to clipboard operation
hs-hourglass copied to clipboard

[Windows] Cannot print dates before January 1, 1601

Open Elewyth opened this issue 3 years ago • 1 comments

When trying to print a DateTime before Janurary 1, 1601 as follows:

timePrint ISO8601_DateAndTime (DateTime
    (Date 1600 December 31)
    (TimeOfDay 23 59 59 999_999_999))

The following exception is thrown on a Windows system:

uncaught exception: IOException of type InvalidArgument
fileTimeToSystemTime: FileTimeToSystemTime: invalid argument (The parameter is incorrect.)

This seems to be caused by the underlying library https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime being used, which explicitly only supports dates after 1601-01-01.

Possible resolution: Seems like the only possible solution to this issue would be to use a different Windows-API for this functionality.

Elewyth avatar Oct 12 '21 11:10 Elewyth

Sorry. I was going to comment and then I realised this is not relevant to your question.

NicolasDP avatar Oct 12 '21 15:10 NicolasDP