Editing 2928: Software Testing Day
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 28: | Line 28: | ||
In real life, such invalid dates would be rejected or coerced to be valid dates. Failing to account for invalid dates may result in errors, sometimes catastrophic, such as [https://www.theregister.com/2012/03/12/azure_leap_day_confirmed/ the February 29, 2012 Microsoft Azure outage] caused by the server trying to generate a certificate valid until February 29, 2013, a date that does not exist as 2013 being a non-leap year. | In real life, such invalid dates would be rejected or coerced to be valid dates. Failing to account for invalid dates may result in errors, sometimes catastrophic, such as [https://www.theregister.com/2012/03/12/azure_leap_day_confirmed/ the February 29, 2012 Microsoft Azure outage] caused by the server trying to generate a certificate valid until February 29, 2013, a date that does not exist as 2013 being a non-leap year. | ||
− | Treatment of invalid dates varies by the chosen programming language and date-time library. Javascript, for example, would coerce January 0th into December 31st, and 25 o’clock into 1 o’clock the following day. While there is no way to directly create a Javascript Date object using 12-hour notation (because that requires text parsing, and the validation of the text input would just result in an invalid date), the following code snippet represents how far this correction can be | + | Treatment of invalid dates varies by the chosen programming language and date-time library. Javascript, for example, would coerce January 0th into December 31st, and 25 o’clock into 1 o’clock the following day. While there is no way to directly create a Javascript Date object using 12-hour notation (because that requires text parsing, and the validation of the text input would just result in an invalid date), the following code snippet represents how far this correction can be abused: |
// In Javascript, month 0 is January | // In Javascript, month 0 is January |