Thank you.

The https://www.sqlite.org/lang_datefunc.html page doesn't seem to make it 
clear what strftime() returns.  The specification it gives for strftime() is:

strftime(format, timestring, modifier, modifier, ...)

Given the lack of an indication of the return type, it seemed to me to be 
reasonable to assume that since I'm passing in a string as one of the 
arguments, I'd get a datetime object out.  It did not seem reasonable to me to 
merely pass in a string of a forced format, the ISO standard format Dr. Hipp 
mentioned, to get a string in some other format.  

But I've been burned before by data types, or lack thereof, in SQLite.  I 
usually work in C# and PostgreSQL, where variables and data columns always have 
definite data types, and, if I remember correctly (it's been a couple of years 
since I worked with SQLite), SQLite does things differently.  I know there's 
nothing stopping me from putting any value into a field, regardless of the type 
of data other records have for that field.

RobR

-----Original Message-----
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Donald Griggs
Sent: Wednesday, March 08, 2017 2:40 PM
To: SQLite mailing list
Subject: Re: [sqlite] Why isn't my time formatting working?

Hi Rob,

The format string of '%d/%m/%Y %H:%M:%S' describes what you want as output, not 
what you're supplying as input.

You can use substr() and concatenation || to mash up your original string into 
the ISO format (which is much easier to handle anyway.) 
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to