Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

SQLite Date format changes

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-19-2009, 02:33 PM
Junior Member
 
Join Date: Aug 2008
Location: Guildford, UK
Posts: 28
Default SQLite Date format changes

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
Reply With Quote
  #2 (permalink)  
Old 06-19-2009, 03:01 PM
Senior Member
 
Join Date: Dec 2007
Posts: 149
Awards Showcase
Beta Tester Beta Tester 
Total Awards: 2
Default SQL DateFormat

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

Best regards
Bernd Goedecke
Reply With Quote
  #3 (permalink)  
Old 06-19-2009, 03:10 PM
Junior Member
 
Join Date: Aug 2008
Location: Guildford, UK
Posts: 28
Default

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
Reply With Quote
  #4 (permalink)  
Old 06-23-2009, 08:28 AM
Junior Member
 
Join Date: May 2009
Posts: 15
Default

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
__________________
-----------
Best Wishes
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Sqlite Version with new DateTime format? berndgoedecke Beta Versions 2 05-06-2009 08:41 PM
setting calendar value from a sqlite date Ricky D Questions (Windows Mobile) 2 01-23-2009 12:54 PM
Date save as zero (0) in the SQLite database mozaharul Questions (Windows Mobile) 2 04-02-2008 09:25 AM
working with date gjoisa Questions (Windows Mobile) 3 03-29-2008 09:40 AM
Date format problem Scubaticus Questions (Windows Mobile) 10 07-03-2007 05:32 PM


All times are GMT. The time now is 04:30 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0