Youth culture killed my dog 1 of 1 article Change bannerposts rsscomments rss

Greatest API design evar   02 Sep 04
[print link all ]

<pre> <steveny> Never do this: <steveny> Calendar calendar = Calendar.getInstance(Locale.US); <steveny> calendar.set(Calendar.MONTH, month); <steveny> calendar.set(Calendar.YEAR, year); <steveny> if it is the 31st now (the calendar.getInstance() returns the current time) <steveny> setting the month to a month with < 31 days <steveny> will cause the calendar be set to the 1st of the next month <darrend> niiiice <steveny> yep <richier> greatest API design evAR <steveny> so never do that ;) </pre>


|

 

Copyright © 2024 Leslie A. Hensley