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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:12:00+00:00 2026-05-27T04:12:00+00:00

Odd question, but you have to know first that Facebook API defines all the

  • 0

Odd question, but you have to know first that Facebook API defines all the dates with a timestamp (long = number of second) started 01/01/1970 00:00:00 located on PDT timezone (Pacifica time).
This number of second is not a UTC timestamp but a fake one based on a non-standard location.

Is there a simple way in java to convert this long timestamp to a normal Date object I could use (and print in french format with standard date formaters) ?

PS : It is not just a +7 hours question, daylight savings are included in this timestamp. In addition, we have also daylight saving in France but not the same ones…

Thanks

UPDATE :
It is more complicated that just à fixed delta.
I think Facebook records the date I give as a PSD date. If I record Thursday 26/10/2011 16H00 (Paris Timezone), Facebook records 26/10/2011 16H00 (San Francisco Timezone) and converts it to the appropriate number of second UTC since 1970. The problem is that this convertion takes into account daylight savings in San Francisco.
I did the following benchmark to demonstrate it :

  • (31/12/2011 16:00 – France Time) FB Timestamp = 1325376000 instead of 1325343600 (Timestamp UTC) -> Delta : -32400
  • (31/07/2012 16:00 – France Time) FB Timestamp = 1343775600 instead of 1343743200 -> Delta : -32400
  • (03/10/2012 16:00 – France Time) FB Timestamp = 1349305200 instead of 1349272800 -> Delta : -32400
  • (28/10/2012 08:00 – France Time) FB Timestamp = 1351436400 instead of 1351407600 -> Delta : -28800
  • (25/03/2012 08:00 – France Time) FB Timestamp = 1332687600 instead of 1332655200 -> Delta : -32400
  • (24/03/2012 23:30 – France Time) FB Timestamp = 1332657000 instead of 1332628200 -> Delta : -28800
  • (27/10/2012 23:30 – France Time) FB Timestamp = 1351405800 instead of 1351373400 -> Delta : -32400

In fact I need a way to convert 31/10/2011 16H00 (PDT) to 31/10/2011 16H00 (Paris TZ)…

  • 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-27T04:12:01+00:00Added an answer on May 27, 2026 at 4:12 am

    When you create the SimpleDateFormat you can specify the timezone. The Date it produced is GMT+0. You can display it in your local timezone by using another SimpleDateFormat with your timezone. (Or you could use JodaTime to do the same)

    If you need the number of milli-seconds since 1/1/1970 in the PST timezone you can do

    public static final long PST_1970; static {
        try {
            final SimpleDateFormat MM_DD_YYYY = new SimpleDateFormat("MM/dd/yyyy");
            MM_DD_YYYY.setTimeZone(TimeZone.getTimeZone("PST"));
            PST_1970 = MM_DD_YYYY.parse("01/01/1970").getTime();
        } catch (ParseException e) {
            throw new AssertionError(e);
        }
    }
    
    public static void main(String... args) throws InterruptedException {
        long now = System.currentTimeMillis();
        long timeSincePST = now - PST_1970;
        System.out.println("now since 1970 GMT " + now);
        System.out.println("millis since 1970 PST " + timeSincePST);
    }
    

    As GMT doesn’t have daylight savings changes it is a good general time to use.

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

Sidebar

Related Questions

I know that this question have been asked several times. But I can't get
So this might be an odd question, but I have a C# program that
I know that question sounds a little odd but i will try to explain
I know it's an odd question, but does JavaScript have the capacity to work
I guess this is kind of an odd question but I have tried setting
This might sound a bit of an odd question but I know what I
This is my first question on S.O. I have a very odd problem. Below
I know this is an odd question, but I'm wondering if this is possible.
I know this question is going to be...weird and...odd. I have programmed stuffs for
Perhaps an odd question but here it goes: I have a function which I

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.