J junaidahmed Well-Known Member Licensed User Longtime User May 16, 2011 #1 How to Change below String to Data Format as YYYY-MM-DD HH:MM Dim StrDate as String StrDate = "16-05-2011"
How to Change below String to Data Format as YYYY-MM-DD HH:MM Dim StrDate as String StrDate = "16-05-2011"
Erel B4X founder Staff member Licensed User Longtime User May 17, 2011 #2 Here: B4X: DateTime.DateFormat = "dd-MM-yyyy" Dim t As Long t = DateTime.DateParse("16-05-2011") DateTime.DateFormat = "yyyy-MM-dd HH:mm" Dim s As String s = DateTime.Date(t) Note that the case of the format characters is important. See this page for the meaning of each character: SimpleDateFormat (Java 2 Platform SE v1.4.2) Upvote 0
Here: B4X: DateTime.DateFormat = "dd-MM-yyyy" Dim t As Long t = DateTime.DateParse("16-05-2011") DateTime.DateFormat = "yyyy-MM-dd HH:mm" Dim s As String s = DateTime.Date(t) Note that the case of the format characters is important. See this page for the meaning of each character: SimpleDateFormat (Java 2 Platform SE v1.4.2)
R RJB Active Member Licensed User Longtime User Apr 21, 2016 #3 link now: https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html Upvote 0