about dateformat

icefairy333

Active Member
Licensed User
Longtime User
load data from csv file,convert date data to long use
B4X:
DateTime.DateFormat="yyyy-mm-dd"
it works
this
B4X:
DateTime.DateFormat="yyyy-MM-dd"
not work
the csv example :
B4X:
date,name,pinyin,age,tel,address,temporary,note,user
 2012/12/1,Joan,joan,7,0,null,null,null ,admin
and
B4X:
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
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…