Android Question [Solved] DateTime.Parse is not converting the date back correctly.

Zhien

Member
Licensed User
I am trying to convert the following code block from 12/04/2019 to long, and then back to string again.
But it seems the Long value is incorrect? I am doing this conversion as a test to see how well the parsing works.
Notice 12/04/2019 is now changed to 12/30/2019



Test 1 - This works now. "Y" is meant for Week Year, not regular year.
B4X:
    DateTime.DateFormat = "MM/dd/yyyy"
    Dim lDate As Long = DateTime.DateParse("01/12/2019")
    DateTime.DateFormat = "MM/dd/yyyy"
    Dim sDate As String = DateTime.Date(lDate)
    Log(sDate)
 
Last edited:

Zhien

Member
Licensed User
Thank you, sorry I got carried away from this irritating bug. I thought I was going crazy.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…