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

  • Home
  • SEARCH
  • 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 9009695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:16:06+00:00 2026-06-16T02:16:06+00:00

I have a Field in Mongo DB called as updated_at Which will look in

  • 0

I have a Field in Mongo DB called as updated_at

Which will look in DB this way

updated_at : NumberLong(“1355754242785”)

This Updated_at filed is created in Database this way

long now = System.currentTimeMillis();

From one of the DB Record , i have taken a value as

updated_at" : NumberLong("1355754242785"), "volatility12" : "na", "vwap" : "0", "wk52hi" : "0", "wk52hidate" : "----"}

For example say its value is 1355754242785

Is it possible to convert the 1355754242785 , when this was Updated ??

When i tried converting

public class Aim {
    public static void main(String[] args) {
        DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS");
        long now = 1355754242785; // Error here saying out of range 
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(now);
        System.out.println(now + " = " + formatter.format(calendar.getTime()));
    }
}
  • 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-16T02:16:08+00:00Added an answer on June 16, 2026 at 2:16 am

    Change

      long now = 1355754242785; // Error here saying out of range 
    

    to

    long now = 1355754242785L; 
    

    This is a compilation error, for the assignment; that should give you a clue that the problem has nothing to do with dates, just with the fact that a literal number in Java is assumed to be an int, which have a maximum value of 2^31-1 . You must add the L suffix to tell Java that the literal is to be interpreted as a long.

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

Sidebar

Related Questions

I have a field in my database called 'Stock'. It displays how many items
I have to read an existing mongo database. Is mongoid suitable for this? All
I have a field called fruit_type which is a node reference to a fruit
I have a mongo collection which has documents with two fields fieldA and fieldB,
I have field like a_b_c_d I want as the output a b c_d, this
in my jqgrid i have field in a table which represents the id and
I have a mongo store task, that has an array answers, which takes a
I'd like to query a mongo collection for records which either don't have a
I have a mongo collection with documents. There is one field in every document
I have got field in my Mongo table that is stored as a Hash.

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.