DateTime parse problems after update version

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43
Hi guys... we upgrade from 5.16 and 5.29 to 5.47.
All our projects with datetime.parse functions became to error, the problem is culture info....
Our system date time format:
dd/MM/yyyy

Old projects:
Код:
DateTime dt = DateTime.Parse("01/12/2020");
project.SendInfoToLog("D: "+dt.Day.ToString());
project.SendInfoToLog("M: "+dt.Month.ToString());
project.SendInfoToLog("Y: "+dt.Year.ToString());
Result:
D: 01
M: 12
Y: 2020

With new verions:
D:12
M: 01
Y: 2020

Edit.:
5.44 >> working
5.45. >> working
5.46 >> Broken
5.47 >> Broken
 
Последнее редактирование:

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43
Solved, move to bugs.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 453
Благодарностей
5 913
Баллы
113
Not sure what is actually the bug there. DateTime format depends on regional and language settings in your system.
For some countries it can be Month/Day/Year, for others Day/Month/Year
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43
For a strange reason on the same operational system and same computer, versions 5.45 and earlier the result of a date time parse works fine and 5.46 and newer not work.

If not a bug, this is a bad implementation: overide system language settings and use only one.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)