luger

_DateTimeFormat wrong output :(

9 posts in this topic

#1 ·  Posted (edited)

Hello, My English is not good. :)

  Example

#include <Date.au3>
MsgBox(0, "", _DateTimeFormat("2017/05/02 12:47:56" , 2))

------------------------------------------------------------------------------------------------------

sshot-1.png

sshot-2.png

This date difference is very annoying. 

Why is this happening? A mistake?

Note: @AutoItVersion ;-->v3.3.14.2

Edited by luger

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

9 hours ago, Jos said:

What exactly are these regional date settings of both systems?

Jos

sshot-1.png

sshot-2.png

sshot-3.png

sshot-4.png

Edited by luger

Share this post


Link to post
Share on other sites

#4 ·  Posted

Kisa saat and Uzun saat are different, please try to match them...

Kind Regards

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

5 hours ago, alien4u said:

Kisa saat and Uzun saat are different, please try to match them...

Kind Regards

I do not have a problem with the clock.(Kisa saat-Uzun saat)
Edited by luger

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Well you get what you ask for so AutoIt3 does exactly follow the requested formats.

The Win10 system has :  g.aa.yyyy so you only get 1 digit when the day (g) is one digit.
The Win7 system has :  gg.aa.yyyy so you always get 2 digits for day (gg), even when it's only is one digit. 

Make the format the same on both systems and you will see that AutoIt3 will provide the same output.

Jos

Edited by Jos
1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#7 ·  Posted

@Jos Thank You.

I realized when I took pictures and experimented.

Of course your directing was effective in that.

Thanks again for the answers.

The result is positive :)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Hi

Your problem is not your code or AutoIt. :)

The problem occurs because of a fundamental flaw inside the Windows operating system.  All dates are presented in "Regional" format, to make your life easy.  It does make any type of DATE TIME coding over time zones, or even computers on the same LAN runnign different Regional Settings,  a nightmare.  Microsoft does not support a single, universal, uniform "TODAY" macro to support date and time functions like SQL does.

You either need to get the computers to work the same way, almost always impossible if you cannot directly control those machines.

The only alternative is to use something like DTC by Melba. Link ==> https://www.autoitscript.com/forum/topic/154684-date_time_convert-bugfix-version-27-may-15/

Skysnake

 

 

Edited by Skysnake
1 person likes this

Skysnake

Why is the snake in the sky?

Share this post


Link to post
Share on other sites

#9 ·  Posted

@Skysnake

It was helpful. Thank you:)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now