1

Scenario:

  1. When inserted the date format (2015-08-01), in mongodb it shows as 2015-08-01T04:00:00.000Z, where i expected it to be 2015-08-01T00:00:00.000Z

source data type used data stage: Date target data type specified in mongoDB: Date

Question:

  1. Why 04:00:00 timestamp is coming even though source has only YYYY-MM-DD (without time-stamp)?
  2. Is this the normal behavior of mongodb?
  3. Is there any thing i can do to have only timestamp as T00.00.00.000Z at target?

My requirement is to not convert the date into string format.

closed as off-topic by Philᵀᴹ, Marcello Miorelli, LowlyDBA, George.Palacios, McNets Nov 5 at 21:48

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Philᵀᴹ, Marcello Miorelli, LowlyDBA, George.Palacios, McNets
If this question can be reworded to fit the rules in the help center, please edit the question.

0

Thanks for the inputs. i did some research and found that Universal Time Coordinated is 4 hours ahead of Eastern Daylight Time. Mongodb by default inserts the date in UTC format .So when mongo sees non-UTC format from sourc ( in YYYY-MM-DD) treating it as 12:00am EST , converts into UTC format by adding 4hrs to EDT and 5 hrs when day light savings starts.

hope this helps .

Not the answer you're looking for? Browse other questions tagged or ask your own question.