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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:51:25+00:00 2026-05-23T22:51:25+00:00

i have a little problem with date conversion in java. When i put 19700101

  • 0

i have a little problem with date conversion in java. When i put 19700101 to SimpleDateFormat and then call getTime i got -3600000. I write test:

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
Date date = dateFormat.parse("19700101");
System.out.println(date.getTime());
System.out.println(dateFormat.format(new Date(0)));
System.out.println((new Date(0)).getTime());

Result should be:

0
19700101
0

but i got

-3600000
19700101
0

My question is why SimpleDateFormat return -3600000 (20Nov1969)? Where I can find information about formatting and conversion bugs?

  • 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-23T22:51:26+00:00Added an answer on May 23, 2026 at 10:51 pm

    Which time zone were you using? My guess is you were using GMT+1. Set the timezone to “GMT” and you should get the expected result.

    You are using a default timezone like CEST (GMT+1). When it was 1970/01/01 00:00:00.000 CEST was 1969/12/31 23:00:00.000 GMT which is -1h from 1970/01/01 or -3600000 ms.

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

Sidebar

Related Questions

I have a little Java problem I want to translate to Python. Therefor I
I have a little problem birthday´s get stored as DATE in the MySQL database.
I've got a little problem: In my table I have these rows: PersHist :
i have little problem with boost::asio library. My app receive and process data asynchronously,
I have a little problem with a Listview. I can load it with listview
I've run on a little problem today: I have a JS drop down menu
I have a little demonstration below of a peculiar problem. using System; using System.Windows.Forms;
I’m having a little Architecture problem. In my project I have a Business Logic
I have a problem with a little .Net web application which uses the Amazon
I have a little problem with a query. I'm selecting data using the between

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.