0

In C# you can do DateTime.MinValue, but is there any method for this in JavaScript or HTML?

I am aware of Date(-number) in JavaScript, but the constants for number that I can find are all too big, and there doesn't seem to be a max/min value

Al Amin Chayan
  • 2,460
  • 4
  • 23
  • 41
Isaac
  • 11,409
  • 5
  • 33
  • 45
  • Scrap that, apparently I hadn't found http://stackoverflow.com/questions/11526504/minimum-and-maximum-date – Isaac Aug 10 '15 at 05:18
  • While that answer might suit javascript (i.e. ECMAScript), HTML pages aren't limited to javascript for the scripting language. The [*HTML specification*](http://www.w3.org/html/wg/drafts/html/master/semantics.html#date-state-(type=date)) has no such limit. – RobG Aug 10 '15 at 05:31
  • It might have no limit, but the date input selector gets real buggy in the year 275760 – Isaac Aug 10 '15 at 05:41
  • The implementation notes in HTML5 say: "*For the input of dates before the introduction of the Gregorian calendar, authors are encouraged to not use the Date and Time state … as user agents are not required to support converting dates and times from earlier periods to the Gregorian calendar…*" so that seems to provide a "soft" limit. The [*Gregorian calendar*](https://en.wikipedia.org/wiki/Gregorian_calendar) was introduced at different times in different places, but maybe 1582 is a suitable lower limit. – RobG Aug 10 '15 at 05:52

1 Answers1

1

I believe, this should be Thu, 01 Jan 1970 00:00:00 GMT.

Hope this helps!

Thanks Shyam

SSV
  • 61
  • 1