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 8484303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:20:41+00:00 2026-06-10T20:20:41+00:00

In our database it uses NumberLong to store timestamp. The question is which javascript

  • 0

In our database it uses NumberLong to store timestamp. The question is which javascript function I can use to operate on the timestamp in mongodb shell?

For example, find out the time in millis of the next day of time NumberLong(1330828762699) and the beginning of the current day.

  • 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-06-10T20:20:43+00:00Added an answer on June 10, 2026 at 8:20 pm

    1) “new Date()” in the mongo shell gets promoted to ISODate() so you can use the methods on that;

    > new Date(1330828762699)
    ISODate("2012-03-04T02:39:22.699Z")
    > new Date(1330828762699).getMilliseconds()
    699
    

    2) With regards to timestamps on documents, did you know that there’s a built-in create date you can use?

    > ObjectId("5020317b92c3d21cb851fa1a").getTimestamp()
    ISODate("2012-08-06T21:04:59Z")
    

    3) I would take a look at the 2.2 aggregate framework for manipulating your data. It has some useful date functions you may be able to employ to make useful time-based queries over your data;

    http://docs.mongodb.org/manual/reference/aggregation/#date-operators

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are implementing some system to our customers which uses DB2 database and we
In our database there is a table which is created with ANSI_NULLS OFF .
We have an application that uses NHibernate to connect to our database on SQL
My application uses a PostgreSQL 9.1 database. We're in our beta phase and we
We have a requirement from a client to protect the database our application uses,
In our database we have a user. A user can have certain metadata (Like
We are trying to use Hibernate with a database that uses a lot of
Our application uses an SQLite database file to hold some data in it. The
Our environment uses the ODP.Net oracle database driver. So logically we are using Oracle
I am working on a webservice where we use LINQ-to-SQL for our database abstraction.

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.