Remy Porter’s CodeSOD item for The Daily WTF, dated 2026-10-05, presents an anonymous submission containing legacy Java. The stated job is to find the current time.
Timestamp current = new Timestamp(new Date().getTime());
Date date = new Date(current.getTime());`new Date()` already creates a date-time object for the current moment, and `getTime()` returns its time value. The submitted sequence creates a Date, passes its value into a Timestamp, reads the value back, and uses it to create another Date. Porter says Java’s older date classes were poorly designed, but the API did not require this chain. It was application-made complexity.




Comments
No comments yet — be the first.
Open the discussion
No account or password needed — just enter your e-mail and we’ll send you a one-time sign-in link. First time here? You’re set up automatically.
Your rating will be applied automatically after you sign in.
Check your inbox
We’ve sent a sign-in link to …. Open it on this device — this tab will sign you in automatically.
Nothing arrived? Check your spam folder — and mark the mail as "Not spam" so it lands in your inbox next time.