viewpoint-particle

Author Topic: Time date in defrent formats  (Read 247 times)

erezpaz

  • Newbie
  • *
  • Posts: 44
Time date in defrent formats
« 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

JTaylor

  • Pundit
  • *****
  • Posts: 806
    • Data & Stuff Inc.
Re: Time date in defrent formats
« Reply #1 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

erezpaz

  • Newbie
  • *
  • Posts: 44
Re: Time date in defrent formats
« Reply #2 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().

JTaylor

  • Pundit
  • *****
  • Posts: 806
    • Data & Stuff Inc.
Re: Time date in defrent formats
« Reply #3 on: August 27, 2017, 01:26:42 pm »
Use TimeYmdHms( ) get the datetime and use TimeFormat() for presentation purposes.

Jim

JTaylor

  • Pundit
  • *****
  • Posts: 806
    • Data & Stuff Inc.
Re: Time date in defrent formats
« Reply #4 on: August 27, 2017, 01:27:34 pm »
....or use both TimeYmdHms( ) and TimeDate() if you don't have access to TimeFormat().

Jim