ram ha scritto:
> As far as I know, sqlite will "support" just about any datetime type
> you want, including fractional seconds.
> 
> I put the word "support" in quotes because sqlite doesn't really HAVE a
> date, time, or datetime type -- it stores all of those items as
> strings, and will then allow you to pretend that you've stored a
> datetime by just giving you back exactly what you put in.
> 
> Sqlite also will allow some simple date arithmetic and other date
> expressions assuming it can understand the datetime format you've used
> - what it understands is in the SQLite docs.
> 
> I had at one point changed the SQlite datetime parser when I added a
> patch for smalldatetime and time support, and it was pretty easy - it's
> just a datetime string parser. In fact, I remember adding explicit
> support for microseconds, which were not supported by strptime. Is it
> not working right?
> 

Sorry, it was a my mistake.
I did not noted the split('.') for reading microseconds.

43   def _cvt(self, value, dialect, fmt):
44              if value is None:
45                  return None
46              parts = value.split('.')
47              try:
48                  (value, microsecond) = value.split('.')
49                  microsecond = int(microsecond)
50              except ValueError:
51                  (value, microsecond) = (value, 0)
52              return time.strptime(value, fmt)[0:6] + (microsecond,)


However I do not understad the row #46


Note: the _cvt method can also be used to parse INTERVAL values.



Regards   Manlio Perillo

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to