🦉 🎤   RapidMiner Wisdom 2020 - CALL FOR SPEAKERS DEADLINE IS NOVEMBER 15   🦉 🎤

CLICK HERE TO GO TO ENTRY FORM

When connect to MongoDB date time data are converted to unix timestamp, How come?

TaaTaa Member Posts: 1 Newbie
edited November 4 in Help


Answers

  • sgenzersgenzer 12Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,581  Community Manager
    hi @Taa hmm I have no idea why that is being converted to epoch time but it's easily remedied with the Numerical to Date operator. :smile:
    ----------------------
    Don't forget to submit your great ideas for Wisdom 2020! Deadline is November 15.

    Wisdom 2020 – Call for Speakers Form 
    Tghadiallymbs
  • David_ADavid_A Administrator, Moderator, Employee, RMResearcher, Member Posts: 190  RM Research
    Hi,

    if I remember it was because in the mongoDB entries it wasn't possible to store dates consistently.
    As Scott correctly pointed out, parsing the dates afterwards can be easily done. The other way round (transforming the date into a String of your desired format) can be done with Generate Attribute.

    Best,
    David
    Tghadiallysgenzer
  • kaymankayman Member Posts: 413   Unicorn
    edited November 5
    Mongo date format is ISO UTC format on display, but in reality just a numeric value. So when you import the date format is the numeric representation. As already mentioned numeric to date format converts it back to a date format, but basically it remains the same number behind the scenes.

    Storing a date back to Mongo is therefore easiest done by using the numeric Epoch format and adding .$date to your attribute. Mongo will then nicely convert it again to ISODate format.
    TghadiallyDavid_A
Sign In or Register to comment.