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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:53:21+00:00 2026-05-25T23:53:21+00:00

<?php header(‘Content-Type: text/plain’); $time = ‘0000-00-00 00:00:00’; echo $time . PHP_EOL . PHP_EOL; $time

  • 0
<?php

header('Content-Type: text/plain');

$time = '0000-00-00 00:00:00';
echo $time . PHP_EOL . PHP_EOL;

$time = strtotime($time);
echo $time . PHP_EOL . PHP_EOL;

On our development server, the second $time outputs nothing. A test with var_dump() reveals its value to be false. Which is fine. On a live server, I get 943920000. A test with var_dump() shows that this is an integer.

Why?

Apparently it is fairly common for dates of zero to come up as 30 November 1999. Why? And why on some servers and not on others?

  • 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-25T23:53:22+00:00Added an answer on May 25, 2026 at 11:53 pm

    Reading the PHP Manual page for strtotime(), we get the following:

    Returns a timestamp on success, FALSE otherwise.

    Therefore it follows that on one of your servers, the call to strtotime() is failing.

    So why would it fail? The answer to that is also on the same manual page:

    Errors/Exceptions

    Every call to a date/time function will generate a E_NOTICE if the time zone is not valid, and/or a E_STRICT or E_WARNING message if using the system settings or the TZ environment variable. See also date_default_timezone_set()

    So it seems to me that your one server doesn’t have it’s timezone locale configured correctly.

    All that said and done, I would suggest not using strtotime() for stuff like this, if possible. It is a bit of a clunky old function, and the newer PHP datetime library provides much better/cleaner functionality. You can create a datetime object using it as follows:

    $date = new DateTime('0000-00-00 00:00:00');
    

    hope that helps.

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

Sidebar

Related Questions

No related questions found

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.