stingrae Member Licensed User Longtime User Jul 3, 2018 #1 Hi, My SQL Server DB returns dates as per the following JSON: B4X: { "OrderID": 19, "OrderModifyTS": "2018-07-03T20:59:30+09:30", "OrderRequestedTS": "2018-07-03T20:59:28+09:30", "OrderEstimatedTS": "2018-07-03T21:09:30+09:30" } But when I try the following B4i code, it crashes: B4X: DateTime.DateFormat = "yyyy-MM-ddTHH:mm:ssz" Dim t As Int = DateTime.DateParse(MapOrders.Get("OrderRequestedTS")) Log(t) I've searched here and tried different formats, but without luck. Any advice? Cheers.
Hi, My SQL Server DB returns dates as per the following JSON: B4X: { "OrderID": 19, "OrderModifyTS": "2018-07-03T20:59:30+09:30", "OrderRequestedTS": "2018-07-03T20:59:28+09:30", "OrderEstimatedTS": "2018-07-03T21:09:30+09:30" } But when I try the following B4i code, it crashes: B4X: DateTime.DateFormat = "yyyy-MM-ddTHH:mm:ssz" Dim t As Int = DateTime.DateParse(MapOrders.Get("OrderRequestedTS")) Log(t) I've searched here and tried different formats, but without luck. Any advice? Cheers.
Erel B4X founder Staff member Licensed User Longtime User Jul 3, 2018 #2 stingrae said: But when I try the following B4i code, it crashes: Click to expand... Always post the error message... B4X: DateTime.DateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html Upvote 0
stingrae said: But when I try the following B4i code, it crashes: Click to expand... Always post the error message... B4X: DateTime.DateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
stingrae Member Licensed User Longtime User Jul 4, 2018 #3 Erel said: Always post the error message... Click to expand... Sorry ... Will do from now on. And Thanks Upvote 0
Erel said: Always post the error message... Click to expand... Sorry ... Will do from now on. And Thanks