B4J Question Dateformat causes wrong day nr ?

Sifu

Active Member
Hi, a bit confusion here.
I checked the date video. I need to set the ticks to YYYY-MM-DD in the DB.

When I do not set the dateformat, I get the correct day. Like 2022-07-03
If I set the dateformat, I get the wrong date Like 2022-07-184.

I set the dateformat because I got first 2022.07.03 and I need dashes like 2022-07-03.

timetest:
Sub testtime
    'DateTime.TimeFormat = "HH.mm.ss.SSS"
    'DateTime.DateFormat = "YYYY-MM-DD"
    Dim now As Long = DateTime.Now
    Log(now)
    Log(DateTime.Date(now))
    Log(DateTime.Time(now))
    
    'Log("Today is: " & DateTime.Date(DateTime.Now))
    'Log($"The current date is: $DateTime{now}"$)
End Sub

B4X:
Waiting for debugger to connect...
Program started.
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
1656842958882
2022-07-184
12:09:18
Today is: 2022-07-184
Anyone knows what I do wrong and get 184 instead of the actual day?

Thank you.
 

Sifu

Active Member
Yes true.
I just slapped myself to my forehead when I saw CAPS differences, and wanted to remove my question You've already answered.

Thank you!
 
Upvote 0
Top