The Date and Time and Time
by in CodeSOD on 2026-10-05Today'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.