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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:53:16+00:00 2026-06-13T20:53:16+00:00

Code: date_default_timezone_set(‘America/Los_Angeles’); $textDate = strtotime($date); var_dump($textDate); var_dump($date); The output: int 1352012400 string ’11/04/12′ (length=8)

  • 0

Code:

    date_default_timezone_set('America/Los_Angeles');
    $textDate = strtotime($date);
    var_dump($textDate);
    var_dump($date);

The output:

int 1352012400
string '11/04/12' (length=8)

The issue is that when you convert the actual timestamp out, it’s 1AM EST.

I’m generating this timestamp having set the timezone to PST — what is going on? What am I doing wrong? I can obviously just add two hours, but I really shouldn’t have to! This can’t be a result of timestamp issues with my server or PC, either, because this is happening in abeyance of current time — I’m converting a date from a specific format to the UNIX timestamp for midnight in the morning, that date.

  • 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-13T20:53:18+00:00Added an answer on June 13, 2026 at 8:53 pm

    The actual issue appears to have revolved around the use of DST — because the date in question was at the end of DST, time calculations became skewed by about one hour. How that turned what should have been 3AM EST into 1AM EST I’m not sure (perhaps the website I used to do the quickie conversion was off), but it also explains why all my math was coming out wrong no matter how many times I checked it.

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

Sidebar

Related Questions

** The Code** $ah_title = $_POST['ah_title']; $ah_postin = $_POST['ah_postin']; $ah_content = $_POST['ah_content']; date_default_timezone_set('America/Los_Angeles'); $ah_date
Code first echo time() . '<br/>'; echo date('Y-m-d H:i:s') . '<br/>'; date_default_timezone_set('America/New_York'); echo time()
Say I have the following code: struct date { int day; int month; int
Superclass source code public class Date { private int month; private int day; private
I have this value +05:00 this is my code date_default_timezone_set('UTC'); echo date('H:i A P');
date_default_timezone_set('America/Guayaquil'); $cnn->execute('SET NAMES utf8'); $cnn->execute('SET GLOBAL time_zone = -5:00'); Hi, the code above is
ELMAH shows host, code, type, error, user, date and time by default on its
Having code: Date::Date(const char* day, const char* month, const char* year):is_leap__(false) { my_day_ =
PHP code: echo date(c); //out put like this 2012-06-19T20:37:44+05:30 echo date(d M, Y); //out
This is the php code for date format on my web page function starkers_posted_on()

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.