i think i got it. 

echo date("M-d-Y H:i:s", mktime());
date() is php. 

thanks. 


dotolee wrote:
> 
> i'm storing as integers now in the database. 
> getting the unix time in seconds using the mktime() method. 
> now i just need to figure out how to display properly. 
> 
> for example, in the sample below, i'm having a hard time getting the
> minutes to show up as minutes.  right now, the "m" is displaying the
> month. 
> 
> echo date("M-d-Y H:m:s", mktime());
> 
> i've read http://www.sqlite.org/lang_datefunc.html but i can't seem to get
> it to work.
> 
> 
> Simon Slavin-3 wrote:
>> 
>> 
>> On 23 Jan 2012, at 5:53pm, Stephan Beal wrote:
>> 
>>> On Mon, Jan 23, 2012 at 6:51 PM, dotolee <woo_ju...@yahoo.com> wrote:
>>> 
>>>> i'm new to sqlite... and relatively new to php.  just wondering what
>>>> the
>>>> best way is to store and compare dates.
>>> 
>>> For any given 10 developers you'll likely hear 11 opinions on this
>>> topic.
>> 
>> How true.  For what it's worth, here's mine:
>> 
>> 1) read
>> 
>> http://www.sqlite.org/lang_datefunc.html
>> 
>> 2) If you need to do maths on dates (how many days apart are two dates,
>> what's three days after this date, etc.) store your dates as numbers,
>> either julianday or unixepoch.
>> 
>> 3) Otherwise store them as text, in YYYYMMDD format, so they're easy to
>> read when you're debugging.
>> 
>> Simon.
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> 
>> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/storing-and-comparing-dates-in-sqlite-tp33189769p33190888.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to