SQLite Date format changes

mikewhite

Member
Licensed User
Longtime User
Hi,

I've gone back to a 6.5 project and am now changing it in 6.8

Am I right in thinking that the date format returned from SQLite databases is now different? I'm pretty sure I used to get date/times back like this

yyyy/mm/dd but now see them in dd/mm/yyyy (UK - where I am) format.

Is this how its supposed to be? I want to make sure before I adjust my code.

Thanks

Mike
 

berndgoedecke

Active Member
Licensed User
Longtime User
SQL DateFormat

Hello Mike,
the date should be formated as it is configured in the
Regional Settings.

Best regards
Bernd Goedecke
 

mikewhite

Member
Licensed User
Longtime User
Thanks for that. What I've found is that I now have to select datetimestamp fields like this:

select datetime(fieldinquestion)

to get it in the form I was expecting, and was the default, of yyyy-mm-dd

Mike
 

ayman12

Member
Licensed User
It look like in SQLite there is no data type, i.e all the data have the same type which is text, but the type you put in the create SQL command is the prefared type.
(some body has to fix me if it is worng).

see
Datatypes In SQLite Version 3

and this
SQLite Frequently Asked Questions

so i prefare if you put you date value as yyyymmdd-hhmmss
I made function to convert to this format.
some thing like this

'-----------------------
Sub MainSub
MsgBox (MySub(NOW))
End Sub
'------------------------
Sub MySub (lngNow)
Dim strCurrDate
DateFormat ("yyyymmdd")
strCurrDate = Date(lngNow)
Return strCurrDate
End Sub
 
Top