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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:15:51+00:00 2026-05-15T06:15:51+00:00

In .net , there are the static properties DateTime.MinDate, and DateTime.MaxDate that conveniently return

  • 0

In .net, there are the static properties DateTime.MinDate, and DateTime.MaxDate that conveniently return the minimum and maximum valid dates for a DateTime object.

I’m dabbling in web programming right now, using php + mysql + javascript. There doesn’t seem to be the same convenient min/max date values in that programming environment? For example, the max value of a date object in mysql is 9999-12-31, but the php function strtotime() doesn’t like that value.

I would like a cross-language minimum date (to be used to mean ‘not set yet’ for example), and a cross-language maximum date (to be used to mean ‘good forever’). That means there could be those min dates and max dates stored in a database, which php would retrieve (and it would have to differentiate between ‘normal’ dates and min/max date), and eventually they would trickle down to some javascript (which, again would have to differentiate between ‘normal’ dates and min/max date).

So, which date value do you use for min/max dates when working in php + mysql + javascript? And how do you store these constants — it’d be nice to define them only in one place and have them be available in each of php + mysql + javascript…

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-05-15T06:15:52+00:00Added an answer on May 15, 2026 at 6:15 am

    I’ll just answer the PHP portion of the question. According to the PHP date() documentation:

    The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer)

    PHP uses 32 bit integer values to represent date/time — that means you can use the PHP_INT_MAX constant to derive the integer values associated with the min/max dates:

    echo date('m/d/Y G:i:s', PHP_INT_MAX + 1); // minimum valid date
    echo date('m/d/Y G:i:s', PHP_INT_MAX); // maximum valid date
    

    OUTPUT:

    12/13/1901 15:45:52

    01/18/2038 22:14:07

    Not sure why that’s off by 2 seconds on the min date they quoted, but you get the general idea.

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

Sidebar

Related Questions

Let's assume there is a static .Net method static void RegisterDelegate(Action<array<Object^>^>^ handler); defined in
In .NET there are 8 bytes of overhead for each object. 4 bytes are
Are there simple libraries out there (.NET and Java) that are able to validate
We are about to break our controllers up: actions that return semi-static HTML pages,
There is a custom data type for business object properties in one of my
Is there any way in .net to bind a dictionary of properties to an
.NET pros out there I have a problem that i would like to share
In VB.NET there is a keyword 'shadows'. Let's say I have a base class
In CruiseControl.NET there appears to be the same xsl stylesheets in the server directory
My problem is in my navigation bar, which can be found here: http://grupocoral.netai.net/ There

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.