Android Question Incorrect Month Name Returned

Mashiane

Expert
Licensed User
Longtime User
Hi

I seem to be getting the wrong month name returned from my method, can someone please advise what I might be doing wrong please?

B4X:
Sub NiceDate(sDate As String) As String
    DateTime.DateFormat = "yyyy-mm-dd"
    Dim dt As Long = DateTime.DateParse(sDate)
    DateTime.DateFormat = "MMMM dd, yyyy"
    Return DateTime.Date(dt)
End Sub

I'm passing "2015-10-04" (in yyyy-mm-dd format) to it and its returning January 04, 2015.
 
Top