Using date values

41 views
Skip to first unread message

Joe

unread,
Oct 29, 2025, 3:41:50 PM (9 days ago) Oct 29
to innosetup
I would like to read and write Delphi TDate values in the Windows registry, but I cannot find a support function to do that. Can anyone help?

Thank you!

Bill Stewart

unread,
Oct 29, 2025, 4:12:08 PM (9 days ago) Oct 29
to innosetup
On Wednesday, October 29, 2025 at 1:41:50 PM UTC-6 Joe wrote:

I would like to read and write Delphi TDate values in the Windows registry, but I cannot find a support function to do that. Can anyone help?

Under the hood, all Windows registry values are just a series of bytes, and there's a "hint" type that clues in an application how to interpret the bytes; e.g.: REG_DWORD, REG_SZ, etc. But there is no "date" value type for the registry.

When applications need to store a date in the registry, they use a workaround such as a parseable string, an unsigned 32-bit integer (i.e., REG_DWORD) that's a number of seconds since some epoch time, or something similar.

Joe

unread,
Nov 3, 2025, 1:48:31 PM (4 days ago) Nov 3
to innosetup
Hi Bill,

Thank you for your reply. Yes, I could save the date in human-readable string value and then convert it to Delphi TDate when needed. However, my software uses the Delphi TRegistry.WriteDate method to store and retrieve the license expiration date from the Windows registry, and I was hoping that coudl continue to use that registry entry as is. Bu I guess I can convert it to a date string.

Thanx,
joe

Eivind Bakkestuen

unread,
Nov 3, 2025, 11:41:27 PM (4 days ago) Nov 3
to inno...@googlegroups.com
You can look at the Delphi implementation of WriteDate and implement it in IS [Code], or create a tiny helper DLL

--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/62a56812-d954-4620-980f-5f3368f045ean%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages