문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top