Skip Menu |

This queue is for tickets about the DateTime-Format-Oracle CPAN distribution.

Report information
The Basics
Id: 27130
Status: resolved
Worked: 2 hours (120 min)
Priority: 0/
Queue: DateTime-Format-Oracle

People
Owner: Nobody in particular
Requestors: jaybuffington [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: 0.03



Subject: warn when $ENV{NLS_DATE_FORMAT} doesn't exist
Thanks for this great module, it was exactly what I was looking for. I'm using it under mod_perl. mod_perl seems to be clobbering the NLS_DATE_FORMAT env variable. I'm not sure why that is happening, and I've worked around it by setting it every where the database handle is requested. This patch warns when NLS_DATE_FORMAT can't be determined: --- DateTime/Format/Oracle.pm 2006-11-03 20:46:32.000000000 -0800 +++ /usr/lib/perl5/site_perl/5.8.5/DateTime/Format/Oracle.pm 2007-05-14 11:32:47.000000000 -0700 @@ -55,7 +55,14 @@ =cut -sub nls_date_format { $ENV{NLS_DATE_FORMAT} } +sub nls_date_format { + if ( exists $ENV{NLS_DATE_FORMAT} ) { + return $ENV{NLS_DATE_FORMAT}; + } else { + warn "NLS_DATE_FORMAT environment variable not set. Defaulting to 'YYYY-MM-DD HH24:MI:SS'"; + return 'YYYY-MM-DD HH24:MI:SS'; + } +} =item * parse_datetime