Bug? Date format forces date to jump to 2020

Pedro Caldeira

Active Member
Licensed User
Longtime User
Hello All,
I have a program that uses datepickers, and a customer today reported errors in the date.

After a quick look, i discovered that if I get the actual system date with datetime.date(datetime.now), I get 12/31/2019, that is correct
if I change the format to DateTime.DateFormat="YYYY-MM-dd" because that's what I use in that system, due to compatibility with other DB, i get 31-12-2020.

Any Idea ??

Regards
 

LucaMs

Expert
Licensed User
Longtime User
Hello All,
I have a program that uses datepickers, and a customer today reported errors in the date.

After a quick look, i discovered that if I get the actual system date with datetime.date(datetime.now), I get 12/31/2019, that is correct
if I change the format to DateTime.DateFormat="YYYY-MM-dd" because that's what I use in that system, due to compatibility with other DB, i get 31-12-2020.

Any Idea ??

Regards
1577789279547.png
 

Pedro Caldeira

Active Member
Licensed User
Longtime User
however, if I pick separately the day, month and year, even after the dateformat, I get the correct values
B4X:
Dim DayToday As String = DateTime.GetDayOfMonth(DateTime.Now) ' I get 31
Dim MonthToday As String = DateTime.GetMonth(DateTime.Now) ' I get 12
Dim YearToday As String = DateTime.GetYear(DateTime.Now) ' I get 2019

if i get the whole date like before, I get 2020-12-31
 
Top