Witness the JavaScript Date Object.
WTF I can spot :
- getTime() returns... the time-of-day part of timestamp ? Nope : the internal counter wich is milliseconds since epoch.
- getDay() returns... monthday ? Nope : weekday.
- getDate() returns... the calendar part of timestamp ? Nope : monthday.
- getYear() returns... the year part of timestamp ? YES, but on 2 digits. As a string then ? Nope : as an integer.
- getFullYear() returns... the full year ? Not quite : on 4 digits, because y10k bug quota is not met yet.
- getTimezoneOffset() returns... millisenconds just like getTime() ? Nope : minutes.
- Being named just Date instead of DateTime or Timestamp since it tracks calendar and clock time.
- Having both getTime() and valueOf(), wich actually return the same thing.
- Having had at first year on 2 digits, for a language designed as far back as... 1995.
- toDateString() & toTimeString() and toLocaleDateString() & toLocaleTimeString() split timestamp into calendar & clock parts... unlike get/setDate() & get/setTime().
- The toISOString() and toUTCString() variants to split into calendar & clock parts are... whoops they don't have any.
- Handling calendar & clock splitting only as output formatting. Because nobody ever computes on these.
- parse(datestring) returns... a Date object ? Nay, it's internal counter.
- The UTC equivalent of parse() is... parseUTC() ? Try again : UTC().
- Handling the UTC vs local difference as... apparently a unique and global timezone, with duplicate methods for input & output. So in order to develop a traveller's agenda, one has to... erm.
Can you spot more ?
Disclaimer : I am not a real developper. But I know crap when there is a big pile of it.