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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:10:52+00:00 2026-05-12T14:10:52+00:00

I want to be able to change the base millisecond reference from 1970 to

  • 0

I want to be able to change the base millisecond reference from 1970 to 2008 in Java so
that I can save space in the database and unique Ids.

Preferably with Joda-Time.

The upcoming jsr-310 in the supposed Java 7 release implements it.

In the The Discrete Timeline section of this link it states that the counting of milliseconds has changed from 1970 to 2008

http://today.java.net/pub/a/today/2008/09/18/jsr-310-new-java-date-time-api.html


The only other option I can see is to mathematically implement it every time
I need to look up a record.

E.g.

DateTime dt = new DateTime();  
long now = dt.getMillis();

DateTime dt2 = new DateTime(2008, 1, 1, 0, 0, 0, 0);  
long then = dt2.getMillis();

long smallerDate = now - then;

Smaller date will be stored in the DB

— Edit —

So I misread the JSR-310, and it’s not possible.

There are better ways to save space and then a headache of
processing thousands of request to calculate longs.

I wanted to record longs as dates because I’ll never know where I will move
the DB to, perhaps MySQL => Oracle.

So I didn’t want timestamps, I just wanted BigInts.

  • 1 1 Answer
  • 3 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-12T14:10:53+00:00Added an answer on May 12, 2026 at 2:10 pm

    No you can’t, and it would be a bad idea if you could. Every timestamp in your database is going to use the same space, regardless of how big the number is. (Assuming you are storing the number as a number and not as a string or something.)

    Now, if you really want this, you’ll have to write it yourself. I.e. subtract the time from your timestamps before putting them into the database, and add the time to the timestamps when you get them back out. But this is asking for maintenance problems. (In fact, using timestamps instead of the database’s native DATETIME datatype is asking for problems.)

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

Sidebar

Related Questions

I want a form where user can change password. I am able to encrypt
I want to be able to change the status message for Live Messenger, but
I want to be able to change the appearance of the mouse cursor as
As the title suggests. I want to be able to change the label of
All I want is to be able to change the color of a bullet
I want to be able to capture the exception that is thrown when a
I want to be able to change dynamically the view folder. The aim is
I want to be able to change the html of the LI tag using
Does exists a java library that can create sql statements? I'm not in search
I have a class that inherits from an abstract base class. I am trying

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.