On Nov 18, 9:45 am, CDR <clair.robe...@gmail.com> wrote:
> Hello,
>
> I've encountered this database exception error: "ORA-01830: date
> format picture ends before converting entire input string."
>
> the sql that produced it was:
>
> sql
> u'INSERT INTO "CBR" ("ORG_ID", "BCID", "NAME", "TCC", "TDC", "TFC",
> "STARTPERIOD", "ENDPERIOD", "STATUS")
>   VALUES (1, 1, Monthly Usage Invoice for ORACLETEST (2009-11),
> 0.0000, 0.0000, 0.0000, 2009-11-01 00:00:00+00:00, 2009-11-30
> 23:59:59.999999+00:00, CURRENT) RETURNING "CBR"."ID" INTO
> <django.db.backends.oracle.base.InsertIdVar object at 0xaa4670c>'
>
> I encountered this from a code base that's been happily running in
> postgres for a long while, and I'm just now trying to get it to run
> against an Oracle 11g backed using the cx_Oracle.
>
> I'm pretty sure it's because the datetime values are not naive, but
> include a tz offset.  Ditching the offset isn't really an option, I
> need to ensure my datetimes are all in UTC for accurate time
> calculations, but still have the ability to present a the data in
> whatever timezone is in settings.py
>
> I've considered modifying the oracle backend to use Oracle's TIMESTAMP
> WITH TIME ZONE datatype, but have not been able to coerce that little
> change in successfully.
>
> I'm using a svn django version from about 2 months ago, I was using
> posgres 8.3, i'm trying to get to Oracle 11g.
>
> Thoughts?
>
> C.

Unfortunately, cx_Oracle currently does not support storing or
retrieving timezone-aware datetimes.  The timezone just gets stripped
off.  The MySQL backend also requires naive datetimes.  I'm not sure
what the official status of the PostgreSQL backend is with regard to
timezone-aware datetimes, although evidently it works.

I would suggest taking a look at the django-timezones app.  I haven't
used it myself, but I believe it's supposed to handle time zone
localization automatically by storing everything in utc.

Regards,
Ian

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.


Reply via email to