Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7059957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:17:41+00:00 2026-05-28T04:17:41+00:00

On shell I tried on test db post = {title : My Blog Post,

  • 0

On shell I tried on test db

post = {"title" : "My Blog Post", "content" : "Here's my blog post.", ... "date" : new Date()}

but when I tried to retrieve it using command

db.blog.find();

its giving me output

{ "_id" : ObjectId("4f13fdc4af1aaf90a686f8ae"), "title" : "My Blog Post", "content" : "Here's my blog post.", "date" : ISODate("2012-01-16T10:35:54.985Z") }

why its showing date as ISODate?? Can I not save date just what new Date() is return in js?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:17:42+00:00Added an answer on May 28, 2026 at 4:17 am

    ISODate is the shell’s helper function to wrap javascript’s Date constructor. Calling ISODate() and new Date() should produce the exact same Date object, it will just be printed differently.

    > var date = new Date(2012,01,16,10,35,54,985)
    > var isodate = ISODate("2012-01-16T10:35:54.985Z")
    > date.constructor == isodate.constructor
    true
    
    > date.constructor
    function Date() {
        [native code]
    }
    > isodate.constructor
    function Date() {
        [native code]
    }
    

    but:

    > date.valueOf()
    1329384954985
    > isodate.valueOf()
    1326710154985
    > 
    

    however if you use the exact same millisecond to construct them then they are equal:

    > date = new Date(isodate.valueOf())
    > print(date)
    Mon Jan 16 2012 11:35:54 GMT+0100 (CET)
    > date.valueOf() == isodate.valueOf()
    true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried using $(date) in my bash shell script, however, I want the date
I have tried : c(module_name). : but this only works from the shell, and
I have an executable that I call using the shell command: Shell (ThisWorkbook.Path &
I tried these two methods: os.system(python test.py) subprocess.Popen(python test.py, shell=True) Both approaches need to
I am trying to run android instrumentation Junit test using command line.I am using
I'd like to increase number of concurrent shells in PowerShell V2.I tried using the
shell>/bin/date -d 091029 20:18:02 +%s 1256827682 Similarly I created shell script: #My.sh myDate=`date +'%y%m%d_%H%M%S'`
I'm using gvim on Windows. In my _vimrc I've added: set shell=powershell.exe set shellcmdflag=-c
This is very stupid but I seem to be completely lost trying to test
As suggested in answers to a previous question , I tried using Erlang proplist

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.