icefairy333 Active Member Licensed User Longtime User Oct 1, 2012 #1 load data from csv file,convert date data to long use Code: DateTime.DateFormat="yyyy-mm-dd" it works this Code: DateTime.DateFormat="yyyy-MM-dd" not work the csv example : Code: date,name,pinyin,age,tel,address,temporary,note,user 2012/12/1,Joan,joan,7,0,null,null,null ,admin and Code: Sub getdblu DateTime.DateFormat="yyyy/MM/dd" Dim m As Map m=DBUtils.ExecuteMap(s,"select lastupdate from sysset",Null) If m.Size<1 Then Return lbldblu.Text="Last update:"&DateTime.Date(m.GetValueAt(0)) End Sub Sub setdblu DateTime.DateFormat="yyyy/MM/dd" DateTime.d Dim t As Long t=DateTime.Now DBUtils.ExecuteWithNoecho(s,"update sysset set lastupdate='"&t&"'") lbldblu.Text="Last update:"&DateTime.Date(t) End Sub in this code must use MM or the read out value will be error for example 10 ---- 54 I want to know what's the different between "yyyy-MM-dd" and "yyyy-mm-dd"? thanks
load data from csv file,convert date data to long use Code: DateTime.DateFormat="yyyy-mm-dd" it works this Code: DateTime.DateFormat="yyyy-MM-dd" not work the csv example : Code: date,name,pinyin,age,tel,address,temporary,note,user 2012/12/1,Joan,joan,7,0,null,null,null ,admin and Code: Sub getdblu DateTime.DateFormat="yyyy/MM/dd" Dim m As Map m=DBUtils.ExecuteMap(s,"select lastupdate from sysset",Null) If m.Size<1 Then Return lbldblu.Text="Last update:"&DateTime.Date(m.GetValueAt(0)) End Sub Sub setdblu DateTime.DateFormat="yyyy/MM/dd" DateTime.d Dim t As Long t=DateTime.Now DBUtils.ExecuteWithNoecho(s,"update sysset set lastupdate='"&t&"'") lbldblu.Text="Last update:"&DateTime.Date(t) End Sub in this code must use MM or the read out value will be error for example 10 ---- 54 I want to know what's the different between "yyyy-MM-dd" and "yyyy-mm-dd"? thanks
D Dman Active Member Licensed User Longtime User Oct 1, 2012 #2 MM = month mm = minute I believe that is how it works. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 1, 2012 #4 The format letters are described here: SimpleDateFormat (Java 2 Platform SE v1.4.2) Upvote 0
icefairy333 Active Member Licensed User Longtime User Oct 2, 2012 #5 so that the phenomenon in my code is so strange Upvote 0