4 ms·
35. People will just assume all APIs and standard libs that deal with dates are sane Adobe managed to build a pretty shitty Date object for ActionScript that t
by hcarvalhoalves 14y ago
35. People will just assume all APIs and standard libs that deal with dates are sane
Adobe managed to build a pretty shitty Date object for ActionScript that takes days as a 1-indexed parameter, but months as 0-indexed. Hopefully ActionScript is not used in banking [1]
[1] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html#Date() http://help.adobe.com/en_US/FlashPlatform/reference/actionsc...
- frankc 14y agoThis is not that insane, or at least relatively insane, because this matches the behavior of localtime(). I have heard the reason for using a 0-indexed month is for the convenience of mapping to an enum of month names.
- sk5t 14y agoIMHO a default month of January makes rather little sense, and would tend to facilitate subtle bugs... it seems you'd want the user to specify a month always, or maybe have a default of "indeterminate" or "Nevember"; the first position of an enum is very often the "nothing" case.