Skip to content
Back to formatted view

Raw Message

Message-ID: <CB45106D-68B0-4138-9CEA-478C92136264@mac.com>
Date: 2008-12-22T16:40:57Z
From: Ivan Alves
Subject: Treatment of Date ODBC objects in R (RODBC)

Dear all,

Retrieving an Oracle "Date" data type by means of RODBC (version  
1.2-4) I get different classes in R depending on which operating  
system I am in:

On MacOSX I get "Date" class
On Windows I get " "POSIXt" "POSIXct" class

The problem is material, as converting the "POSIXt" "POSIXct" object  
with as.Date() returns one day less ("2008-12-17 00:00:00 CET" is  
returned as "2008-12-16").

I have 2 related questions:

1. Is there a way to control the conversion used by RODBC for types  
"Date"? or is this controlled by the ODBC Driver (in my case the  
Oracle driver in Windows and Actual on Mac OS X)?

2. What is the trick to get as.Date() to return the _intended_ date  
(the date that the OS X environment "correctly" reads)?

Many thanks in advance for any guidance.

Best regards,
Ivan