Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In other words, there's actually a 14 month that either contains 1 or 2 days, both of which have no weekday associated with them?

I don't see how it would make things much easier, especially for timestamps in various date formats and date-input fields.



Why? It's still three numeric digits. If anything, it would be much easier to calculate date validity. In Python:

  acceptable_days = range(1,29)
  if pickedMonth == 14:
     acceptable_days = [1];
     if isLeapYear(year): acceptable_days = [1,2]
     # any future hack will just go here 
  
  if pickedDay not in acceptable_days or pickedMonth > 14: 
     raise InvalidDateException()  

Compare this with anything we use today. Which code is simpler?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: