WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: erezpaz on August 27, 2017, 10:04:17 AM

Title: Time date in defrent formats
Post by: erezpaz on August 27, 2017, 10:04:17 AM
Hi

I am collecting date and time from a windows task schedule. It come in format: YYYY:MM:DD:HH:MM:SS. I using timeformat function to convert the time and date to compare it to TimeDate ( ) function. In some windows the TimeDate ( ) present : Sun 27/08/2017 20:00:10 and in some windows it present Sun 08/27/2017 8:00:10 PM. How can i know up front and create the right process to compare it to right format?

Thanks
Erez
Title: Re: Time date in defrent formats
Post by: JTaylor on August 27, 2017, 10:10:20 AM
Why not use TimeYmdHms( )?

Also, you can find the format in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\win.ini[Intl]

Jim
Title: Re: Time date in defrent formats
Post by: erezpaz on August 27, 2017, 10:28:05 AM
I am not using TimeYmdHms since i want to present the user a human-readable format. so i am getting current time from using TimeDate() then comparing that to time date i collected from Windows task in YYYY:MM:DD:HH:MM:SS format. I want to convert the YYYY:MM:DD:HH:MM:SS to same format i get from TimeDate().
Title: Re: Time date in defrent formats
Post by: JTaylor on August 27, 2017, 01:26:42 PM
Use TimeYmdHms( ) get the datetime and use TimeFormat() for presentation purposes.

Jim
Title: Re: Time date in defrent formats
Post by: JTaylor on August 27, 2017, 01:27:34 PM
....or use both TimeYmdHms( ) and TimeDate() if you don't have access to TimeFormat().

Jim