Zhien Member Licensed User Jul 12, 2021 #1 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: Copy 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: Jul 12, 2021
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: Copy 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)
M Mahares Expert Licensed User Longtime User Jul 12, 2021 #2 Zhien said: Notice 12/04/2019 is now changed to 12/30/2019 Click to expand... It should be this way, the y is lower case: Code: Copy DateTime.DateFormat= "MM/dd/yyyy" Please don't put your code as an image. Use text so it is easier for people to help you Upvote 0
Zhien said: Notice 12/04/2019 is now changed to 12/30/2019 Click to expand... It should be this way, the y is lower case: Code: Copy DateTime.DateFormat= "MM/dd/yyyy" Please don't put your code as an image. Use text so it is easier for people to help you
Zhien Member Licensed User Jul 12, 2021 #3 Thank you, sorry I got carried away from this irritating bug. I thought I was going crazy. Upvote 0