S Stephenz43 Member Licensed User Longtime User Oct 3, 2013 #1 I am having a difficulty with the formatting of a column in a scrollview. The column in retrieved from a MS SQL database as follows : row(3) = n.Get("dateShipped") instead of a date I am getting /Date(12315ect How should I be formating to just get 04/15/2013
I am having a difficulty with the formatting of a column in a scrollview. The column in retrieved from a MS SQL database as follows : row(3) = n.Get("dateShipped") instead of a date I am getting /Date(12315ect How should I be formating to just get 04/15/2013
Erel B4X founder Staff member Licensed User Longtime User Oct 3, 2013 #2 What is the value of Log(n.Get("dateShipped")) ? Upvote 0
S Stephenz43 Member Licensed User Longtime User Oct 3, 2013 #3 The value retrieved from the sql Server database should be a date like '05/16/2013' . I'm getting /Date(1377586800000)/ Upvote 0
The value retrieved from the sql Server database should be a date like '05/16/2013' . I'm getting /Date(1377586800000)/
S Stephenz43 Member Licensed User Longtime User Oct 3, 2013 #4 the value of Log(n.Get("dateShipped")) is /Date(1377586800000)/ Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 4, 2013 #5 What you are seeing is the value returned from the server. You will need to parse it. The numeric value seems like the correct ticks value: B4X: Log(DateTime.Date(1377586800000)) Upvote 0
What you are seeing is the value returned from the server. You will need to parse it. The numeric value seems like the correct ticks value: B4X: Log(DateTime.Date(1377586800000))
S Stephenz43 Member Licensed User Longtime User Oct 4, 2013 #6 so , what about the prefix( /d(xxxxxxxxxx)/ doe the /d( and )/ need to be parced out. Upvote 0
W wl Well-Known Member Licensed User Longtime User Oct 4, 2013 #7 You could also consider having SQL convert the date and return it as a string/varchar: B4X: select convert(varchar(10), dateShipped, 101), ... Also see: http://technet.microsoft.com/en-us/library/ms187928.aspx Upvote 0
You could also consider having SQL convert the date and return it as a string/varchar: B4X: select convert(varchar(10), dateShipped, 101), ... Also see: http://technet.microsoft.com/en-us/library/ms187928.aspx
M Mahares Expert Licensed User Longtime User Oct 5, 2013 #8 Hopefully wl's previous post is what you are looking for. If not, here is a way to parse the string: B4X: Dim MyDate As String = "/Date(1377586800000)/" MyDate=MyDate.Substring2(MyDate.indexof("(")+1, MyDate.indexof(")")) 'returns 1377586800000 Msgbox(DateTime.Date(MyDate),"") 'displays 08/27/2013 Upvote 0
Hopefully wl's previous post is what you are looking for. If not, here is a way to parse the string: B4X: Dim MyDate As String = "/Date(1377586800000)/" MyDate=MyDate.Substring2(MyDate.indexof("(")+1, MyDate.indexof(")")) 'returns 1377586800000 Msgbox(DateTime.Date(MyDate),"") 'displays 08/27/2013