Tag

LeapYear

1 views collected around this technical thread.

IT Services Circle
IT Services Circle
Mar 9, 2024 · Backend Development

Common Java Date Handling Pitfalls: Leap Year, Formatting, Timezone, and Thread Safety

This article explains several Java date‑time pitfalls—including leap‑year calculations, differences between YYYY/yyyy and HH/hh patterns, SimpleDateFormat initialization, Calendar hour fields, integer overflow in date arithmetic, thread‑unsafe usage of SimpleDateFormat, and daylight‑saving‑time handling—providing code examples and best‑practice recommendations.

DateFormattingDateTimeJava
0 likes · 10 min read
Common Java Date Handling Pitfalls: Leap Year, Formatting, Timezone, and Thread Safety