Alberto Michelis Well-Known Member Licensed User Longtime User Jul 13, 2015 #1 I read a date form a sqlite database. The fomat is yyyy-dd-MM I need it in dd/MM/yyyy Im using this code but the resulting year is not ok Code: Copy dim f as int dim fecha as string DateTime.DateFormat="yyyy-dd-MM" f = DateTime.DateParse(cursor1.GetString("fecha")) Log(cursor1.GetString("fecha")&" "&f) DateTime.DateFormat="dd/MM/yyyy" fecha = DateTime.Date(f) The log is: 2015-12-7 -2144044160 The resulting string is : 07/12/1969 What am I doing wrong?
I read a date form a sqlite database. The fomat is yyyy-dd-MM I need it in dd/MM/yyyy Im using this code but the resulting year is not ok Code: Copy dim f as int dim fecha as string DateTime.DateFormat="yyyy-dd-MM" f = DateTime.DateParse(cursor1.GetString("fecha")) Log(cursor1.GetString("fecha")&" "&f) DateTime.DateFormat="dd/MM/yyyy" fecha = DateTime.Date(f) The log is: 2015-12-7 -2144044160 The resulting string is : 07/12/1969 What am I doing wrong?
Alberto Michelis Well-Known Member Licensed User Longtime User Jul 13, 2015 #3 Thanks !!!!!!!!!!!!!!! Upvote 0