Question

I need to make a modification to a legacy app written in Turbo Pascal 7 which requires me to find out the current timezone offset. The program runs in a DOS box in a 32-bit XP environment.

Anybody know of a way of doing this?

** EDIT **

I probably should add that the reason for this question is because I want to know the UTC time , i.e. I want a way of calling a GetSystemTime equivalent from DOS.

Was it helpful?

Solution

Try using an Exec statement in Pascal to run the DOS systeminfo command output with a pipe, then parse the resulting output using Pascal. Example...

c:\>systeminfo | find "Time Zone"
Time Zone:                 (UTC-05:00) Eastern Time (US & Canada)

c:\>

It takes a sec on Windows 7 to get the result but it should run faster on XP.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top