Handling 2 digit year in OCCI Timestamp (RRRR year format)

From: Pratish P <pratishpillay_at_mpcs.co.in>
Date: 27 May 2003 06:11:15 -0700
Message-ID: <9adaa272.0305270511.19c1e2ad_at_posting.google.com>


Hi all,

I have recently started trying out OCCI.

Does anyone know how to go about dealing with 2 digit year dates? If I set a OCCI Timestamp object with date "05/25/98" using "mm/dd/yyyy" date format, OCCI returns the year as 0098. OCCI docs tell us to use "mm/dd/rrrr" nls date format that also gives us the century value for the year (1998). But it just does not work! Consider this...

Environment *env = Environment::createEnvironment(Environment::OBJECT); Timestamp ts;
ts.fromText("05/25/98", "mm/dd/yyyy", "mm/dd/rrrr", env); ts.getDate(year, mon, day);
cout << year << endl; // displays 98

Inspite of setting nls date format, the Timestamp gives me year value as 98 and not 1998.

Can anyone help me out??

Thanks Received on Tue May 27 2003 - 15:11:15 CEST

Original text of this message