Tagged articles
13 articles
Page 1 of 1
Top Architecture Tech Stack
Top Architecture Tech Stack
Nov 7, 2024 · Backend Development

Date Formatting Techniques in Spring Boot Applications

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.

Backend DevelopmentDate FormattingDateTimeFormatter
0 likes · 12 min read
Date Formatting Techniques in Spring Boot Applications
Top Architecture Tech Stack
Top Architecture Tech Stack
Nov 4, 2024 · Backend Development

Date Formatting Techniques in Spring Boot Applications

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.

Backend DevelopmentDate FormattingDateTimeFormatter
0 likes · 12 min read
Date Formatting Techniques in Spring Boot Applications
Selected Java Interview Questions
Selected Java Interview Questions
Aug 31, 2023 · Backend Development

How to Solve SimpleDateFormat Thread Safety Issues in High-Concurrency Scenarios

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.

DateTimeFormatterJavaSimpleDateFormat
0 likes · 17 min read
How to Solve SimpleDateFormat Thread Safety Issues in High-Concurrency Scenarios
Selected Java Interview Questions
Selected Java Interview Questions
Feb 12, 2023 · Backend Development

Comprehensive Guide to Java 8 Date and Time API

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.

DateTimeFormatterJavaTimeAPI
0 likes · 24 min read
Comprehensive Guide to Java 8 Date and Time API
Tuanzi Tech Team
Tuanzi Tech Team
Nov 8, 2022 · Backend Development

Why Does SimpleDateFormat Fail in Multithreaded Java? Solutions and Best Practices

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.

DateTimeFormatterJavaSimpleDateFormat
0 likes · 10 min read
Why Does SimpleDateFormat Fail in Multithreaded Java? Solutions and Best Practices
Selected Java Interview Questions
Selected Java Interview Questions
Sep 7, 2022 · Backend Development

Java Date and Time Formatting: Methods, Thread Safety, and Best Practices

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 CommonsDateTimeFormatterSimpleDateFormat
0 likes · 9 min read
Java Date and Time Formatting: Methods, Thread Safety, and Best Practices
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 18, 2021 · Backend Development

Understanding Thread Safety Issues with SimpleDateFormat and Solutions in Java

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.

DateTimeFormatterJavaSimpleDateFormat
0 likes · 13 min read
Understanding Thread Safety Issues with SimpleDateFormat and Solutions in Java
JavaEdge
JavaEdge
Nov 24, 2020 · Fundamentals

Avoid Common SimpleDateFormat Pitfalls and Embrace Thread‑Safe DateTimeFormatter in Java

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.

Date FormattingDateTimeFormatterJava
0 likes · 10 min read
Avoid Common SimpleDateFormat Pitfalls and Embrace Thread‑Safe DateTimeFormatter in Java
FunTester
FunTester
Feb 27, 2020 · Backend Development

Parsing Dates Without a Year in Java: Fixing the Common Error

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.

Backend DevelopmentDate ParsingDateTimeFormatter
0 likes · 4 min read
Parsing Dates Without a Year in Java: Fixing the Common Error
Programmer DD
Programmer DD
Jan 1, 2020 · Fundamentals

Why Using ‘YYYY’ Instead of ‘yyyy’ Can Break Your Java Dates

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
Why Using ‘YYYY’ Instead of ‘yyyy’ Can Break Your Java Dates
Programmer DD
Programmer DD
May 12, 2019 · Backend Development

Why SimpleDateFormat Breaks in Multithreaded Java and How to Fix It

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
Why SimpleDateFormat Breaks in Multithreaded Java and How to Fix It
Java Backend Technology
Java Backend Technology
Mar 19, 2019 · Backend Development

Why SimpleDateFormat Is Not Thread‑Safe and How to Fix It in Java

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
Why SimpleDateFormat Is Not Thread‑Safe and How to Fix It in Java