Five Stars

Oracle to MongoDB is removing one day from dates

Hi,
I am actually using the mongDB API via a tLibraryLoad component, as I find this easier to build complex multi-level documents using tJavaRow and tJava components, than using the MongoDB palette components.
I am reading in data from Oracle which are date values with a zero time stamp component:
29-JUN-08 00.00.00

The records in mongo shell appear to be the previous day.  You can see the record is inserted as the 28-JUN-2008.


 "status_date" : ISODate("2008-06-28T23:00:00Z")


It is almost as if mongoDB sees a midnight date as the end of the previous day, rather than the start of the 29th June 2008.
In my schema I have specified the Oracle columns as Date and DB Type of Date.
I expect this is related to UTC.  However I am not sure where the UTC offset is being introduced.  I am running the job locally on my PC which is UTC+00 (UK).  In Oracle I am storing the date as a "date" and not a "timezone with timestamp" so am not even storing the timezone in the database.  
All I want is the stored date to be captured in mongoDB as captured in Oracle....
Any advice appreciated.
Regards
Stephen

Carpe Diem
3 REPLIES
Moderator

Re: Oracle to MongoDB is removing one day from dates

Hi Stephen,
Could you please also indicate the build version you are using?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: Oracle to MongoDB is removing one day from dates

Is this what you require?
I believe this is to do with Daylight Saving Time.   MongoDB is looking at the raw time from Oracle, and then adjusting due to DST for some reason....If I change my locale settings in Windows to US, then the changes to the dates adjust as to when they kick in - in accordance with DST in the US.
Talend Unified Platform feature 6.0.1.20150908_1633 org.talend.tup.feature.feature.group Talend.
Regards
Stephen

Carpe Diem
One Star

Re: Oracle to MongoDB is removing one day from dates

Any update or answers here?