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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:45:16+00:00 2026-06-08T23:45:16+00:00

For EST time, I’ve set: date_default_timezone_set(America/New_York); As the page loads, I’m getting EST time

  • 0

For EST time, I’ve set:

date_default_timezone_set("America/New_York");

As the page loads, I’m getting EST time via:

$time = time();

The problem is when I convert strings back and forth between timestamps and datetime format:

10/31/2012 7:30pm 1351729800 | 10/31/2012, 8:30 pm
11/2/2012 7:30pm 1351902600 | 11/02/2012, 8:30 pm
11/3/2012 8:00pm 1351990800 | 11/03/2012, 9:00 pm
11/7/2012 8:00pm 1352336400 | 11/07/2012, 8:00 pm
11/9/2012 8:00pm 1352509200 | 11/09/2012, 8:00 pm
11/10/2012 8:00pm 1352595600 | 11/10/2012, 8:00 pm

I’m expecting these date & times to be the same.

The first section (before the “|”) is simply strings, such as “10/31/2012 7:30pm” and the strtotime(“10/31/2012 7:30pm EST”).

The section (after the “|”) is date() of the previous strtotime() value.

What can I do to convert from string to time (strtotime) and double check that the date format returned is the same as the string input?

Thanks

  • 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-08T23:45:17+00:00Added an answer on June 8, 2026 at 11:45 pm

    I’d say that this is because currently New York is on daylight savings time – EDT rather than EST. This affects things like so:

    date_default_timezone_set("America/New_York");
    strtotime("10/31/2012 7:30pm"); // translates to "Wed, 31 Oct 2012 19:30:00 -0400"
    strtotime("10/31/2012 7:30pm EDT"); // translates to "Wed, 31 Oct 2012 19:30:00 -0400"
    strtotime("10/31/2012 7:30pm EST"); // translates to "Wed, 31 Oct 2012 20:30:00 -0400"
    

    The quick fix is probably to not add the timezone to the string, strtotime() will use the correct default timezone you set.

    You can be a bit more exact about how your date is being parsed by using the DateTime createFromFormat function:

    $date = DateTime::createFromFormat('m/d/Y g:ia', "10/31/2012 7:30pm");
    echo $date->format('U');
    

    Alternatively if you wait until November the problem will resolve itself 🙂

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

Sidebar

Related Questions

I want convert GMT time to EST time and get a timestamp. I tried
I have to print the EST time in my Java application. I had set
I'm using the following lines of code to convert the unix time I'm getting
I am looking for the Ruby-est way to solve a problem. I have code
How can I convert DateTime Thu Nov 30 19:00:00 EST 2006 to 11/30/2006
I'm trying to parse timestamp strings like Sat, 11/01/09 8:00PM EST in Python, but
How do I convert a DateTime from EST/EDT to GMT but I don't know
I need to determine the client timezone (e.g. CET, GMT, EST) in JS. Getting
I have written a function to convert a date into a Unix time stamp.
My server is running in MDT So I used following one to convert EST

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.