B4XDev Member Licensed User Apr 14, 2022 #1 Here's a test sub: B4X: Sub testDateFormats Private dstr As String Private dlong As Long Private mystr As String dstr = "3/28/2022" DateTime.DateFormat = "MM/dd/YYYY" dlong = DateTime.DateParse(dstr) DateTime.DateFormat = "YYYY.MM.dd" mystr = DateTime.Date(dlong) Log(dstr & " =? " & mystr) End Sub Here's the output: B4X: 3/28/2022 =? 2022.12.26 I'm completely confused. Can anybody replicate this weirdness? And how do I fix it?
Here's a test sub: B4X: Sub testDateFormats Private dstr As String Private dlong As Long Private mystr As String dstr = "3/28/2022" DateTime.DateFormat = "MM/dd/YYYY" dlong = DateTime.DateParse(dstr) DateTime.DateFormat = "YYYY.MM.dd" mystr = DateTime.Date(dlong) Log(dstr & " =? " & mystr) End Sub Here's the output: B4X: 3/28/2022 =? 2022.12.26 I'm completely confused. Can anybody replicate this weirdness? And how do I fix it?
B4XDev Member Licensed User Apr 14, 2022 #2 I got it resolved, based on a clue from this thread. Instead of the capital Y for the year, use lowercase... ? I would have sworn I saw capital Ys in the examples!!! ? Last edited: Apr 14, 2022 Upvote 0
I got it resolved, based on a clue from this thread. Instead of the capital Y for the year, use lowercase... ? I would have sworn I saw capital Ys in the examples!!! ?