Tagged articles
DateTimeFormatter
17 articles · Page 1 of 1
This guide covers Java date/time handling from legacy Date and SimpleDateFormat to modern JDK 8+ APIs including LocalDateTime, DateTimeFormatter, Period, and Duration with practical code examples and conversion techniques.
DATETIMEDateTimeFormatterDuration
0 likes · 14 min read

This article explains why internationalization and localization should be implemented from the start, covering UTF-8 encoding, locale handling, resource bundles, dynamic content translation strategies, time zone and currency best practices, legal compliance like GDPR, and real-world failure cases.
DateTimeFormatterJavaJavaMoney
0 likes · 12 min read

The article explains how JDK 17’s java.time.LocalDate follows the Single Responsibility Principle by separating date data from formatting, contrasts this design with the older mutable java.util.Date, and shows how to spot classes that take on too many responsibilities.
API DesignDateTimeFormatterImmutable Objects
0 likes · 6 min read

This article explains how LocalDateTime and DateTimeFormatter work together to represent, format, parse, and manipulate date‑time values in Java, covering creation methods, component extraction, arithmetic, custom patterns, timezone conversion, common pitfalls, and practical use cases with concrete code examples.
DateTimeFormatterJavaJava 8
0 likes · 13 min read

This article explains why consistent date formatting is crucial in Spring Boot APIs, outlines common scenarios such as front‑end data exchange, database storage and logging, and presents multiple server‑side and client‑side solutions—including SimpleDateFormat, DateTimeFormatter, global Jackson settings, annotations, custom converters, and timestamp output—complete with code examples.
DateTimeFormatterJacksonJava
0 likes · 12 min read

This article explains various Spring Boot approaches for formatting dates in API responses, covering frontend JavaScript utilities, Java SimpleDateFormat and DateTimeFormatter, global Jackson settings, annotation‑based formatting, custom converters, ControllerAdvice initBinder, and timestamp output methods.
DateTimeFormatterJacksonJava
0 likes · 12 min read

This article presents several common solutions for addressing the thread‑safety problem of Java's SimpleDateFormat in high‑concurrency environments, including using local variables, synchronized blocks, Lock, ThreadLocal, Java 8 DateTimeFormatter, and Joda‑Time, and evaluates their performance and suitability.
ConcurrencyDateTimeFormatterJava
0 likes · 17 min read

This article provides a thorough walkthrough of Java 8's date‑time API, covering formatting patterns, obtaining current dates and times, extracting components, creating specific dates, comparing dates, handling periodic events, timezone offsets, timestamps, custom parsing, common pitfalls, and thread‑safety considerations, all illustrated with clear code examples.
DATETIMEDateTimeFormatterJava
0 likes · 24 min read

An operation team discovered that QR code redirects returned 404 due to expired access tokens, traced to SimpleDateFormat’s thread‑unsafe parsing causing incorrect expiration dates; the article analyzes the root cause, demonstrates failing multithreaded tests, and presents four thread‑safe alternatives including local instances, synchronization, ThreadLocal, and Java 8’s DateTimeFormatter.
ConcurrencyDateTimeFormatterJava
0 likes · 10 min read

This article compares three common Java date‑time formatting approaches—SimpleDateFormat, Java 8’s DateTimeFormatter, and Apache Commons Lang3’s DateFormatUtils—examines thread‑safety issues, provides code examples, and offers conversion utilities between Date, LocalDate, and LocalDateTime for robust backend development.
Apache CommonsDATETIMEDateTimeFormatter
0 likes · 9 min read

This article explains why SimpleDateFormat is not thread‑safe in Java, demonstrates the problem with multithreaded examples, and presents five practical solutions—including local variables, synchronized blocks, explicit locks, ThreadLocal, and the modern DateTimeFormatter—along with their advantages and drawbacks.
ConcurrencyDateTimeFormatterJava
0 likes · 13 min read

This article explains the hidden traps of Java's SimpleDateFormat—such as confusing 'y' and 'Y', week‑year calculations, and thread‑safety issues—demonstrates failures with multithreaded parsing, and shows how to replace it with the modern, thread‑safe DateTimeFormatter, including practical code examples and conversion tips.
DateTimeFormatterJavaJava 8
0 likes · 10 min read

This article explains how using uppercase YYYY and DD in Java date patterns produces week‑based year and day‑of‑year values, leading to unexpected results around year boundaries, and provides code examples and best‑practice recommendations to avoid these formatting bugs.
DateTimeFormatterJavadate-formatting
0 likes · 7 min read

This article demonstrates a common mistake when parsing a date string without a year in Java, shows the resulting DateTimeParseException, and provides a correct solution using DateTimeFormatterBuilder to supply a default year, complete with code examples and expected output.
Date ParsingDateTimeFormatterDateTimeFormatterBuilder
0 likes · 4 min read

A subtle mistake of using the week‑based year pattern ‘YYYY’ instead of the calendar year ‘yyyy’ in Java DateTimeFormatter can cause unexpected date bugs, especially around year boundaries, and this article explains the symptoms, root cause, and how to avoid it.
Date BugDateTimeFormatterJava
0 likes · 3 min read

This article explains why the classic Java SimpleDateFormat class is not thread‑safe, demonstrates the problems caused by using a static instance in concurrent code, and presents four practical solutions—including creating new instances, synchronizing, using ThreadLocal, and switching to the immutable DateTimeFormatter.
DateTimeFormatterJavaSimpleDateFormat
0 likes · 8 min read

This article explains why Java's SimpleDateFormat is not thread‑safe, demonstrates the problems caused by using a static instance in multithreaded code, and presents four practical solutions—including synchronized blocks, ThreadLocal, and the modern DateTimeFormatter—to ensure correct date handling.
DateTimeFormatterJavaSimpleDateFormat
0 likes · 5 min read
