DateTime parse problems after update version

  • Автор темы Автор темы EtaLasquera
  • Дата начала Дата начала

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
527
Реакции
113
Баллы
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
 
Последнее редактирование:
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
 
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.
 

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