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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:36:52+00:00 2026-06-12T22:36:52+00:00

I understand there is an issue with php mktime(), 32bit systems, and years <1901

  • 0

I understand there is an issue with php mktime(), 32bit systems, and years <1901 or >2038, however, my question is, does this issue still remain if operating on a 64 bit system?

I used the code mentioned here and determined my host is running a 64bit system.

I am gathering dates from user inputs in the following format:

$m = user selected month (2 digits); $d = user selected day (2 digits); $y = user selected year (4 digits)

Here is the code I am using to convert the input date into a unix timestamp:

$npt_date=mktime(0,0,0,$m,$d,$y);

And the code to then re-display the date in the basic format xx-xx-xxxx

$date_str=date('m-d-Y',$npt_date);

The code works fine for dates > 1901, however, when $y < 1901, the output from the date() function returns the incorrect date.

Any advice as to what I am doing wrong, if this is even possible using the mktime() and date() functions, and/or possible workaround would be greatly appreciated.

Thanks in advance.

  • 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-12T22:36:54+00:00Added an answer on June 12, 2026 at 10:36 pm

    It might be a good idea to start using DateTime. It’s only limited backwords by the year 1000.
    Also time() and date() are limited by 2038 in the future, whereas DateTime won’t have problem with the future either.
    Here is some reading on the topic.

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

Sidebar

Related Questions

Just to preface my question, I understand that there is no direct support for
Can anybody help me understand why are there two loops here? <?php // create
You'll have to forgive me on this one. I understand that the issue is
There's something I don't fully understand about node cloning with the PHP's DOM api.
I'm new to this, and I think there some issue with my if-else structure,
My question is an elaboration of this one: PHP/MYSQL AJAX Chat I have a
I understand there are lots of settings for setting layouts. Here is a ListCtrl
I understand there are many for math and integers, but instead of x+=y ,
I understand there is plenty of documentation about designing for multiple screen support in
I understand there is a limit to the number of requests per day using

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.