# CodeSOD: The Date and Time and Time

DevFeed: [CodeSOD: The Date and Time and Time](<https://devfeed.tech/articles/codesod-the-date-and-time-and-time-64780.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/the-date-and-time-and-time>)

Author: Remy Porter

Published: 2026-10-05T06:30:00Z

Content type: article

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [versioning](<https://devfeed.tech/topics/versioning.md>), [LocalDate](<https://devfeed.tech/topics/localdate.md>), [OffsetDateTime](<https://devfeed.tech/topics/offsetdatetime.md>), [C time functions](<https://devfeed.tech/topics/c-time-functions.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [codesod](<https://devfeed.tech/tags/codesod.md>), [java](<https://devfeed.tech/tags/java.md>), [legacy](<https://devfeed.tech/tags/legacy.md>), [software](<https://devfeed.tech/tags/software.md>), [time](<https://devfeed.tech/tags/time.md>)

## AI overview

A brief CodeSOD commentary examines legacy Java code that retrieves the current time by converting between Date and Timestamp objects. It calls the extra conversions unnecessary and describes the code as home-grown ugliness.

## Source excerpt

Today's anonymous submitter sends us some legacy Java code. The task is this: check what time it is. And fortunately, even in the older Java datetime libraries that were terrible, this was an easy task. You just needed to do something like new Date(), which constructs a date time object set to the current time. getTime() picks off just the time portion. Or, you could do this. Timestamp current = new Timestamp(new Date().getTime()); Date date = new Date(current.getTime()); This creates a date, picks the time off, populates a timestamp, gets the time from the timestamp, and constructs a new date object. The old Java date classes were awful, but they never needed you to do this. This is entirely home grown ugliness. [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!