Tagged articles
53 articles
Page 1 of 1
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Sep 9, 2025 · Backend Development

Why Adding 2 Days Sometimes Results in a 3-Day Unblock? Java Date Precision Explained

A Java backend bug caused blacklist unblocking times to be stored one second later than expected due to mismatched Date and TIMESTAMP precision, daylight‑saving and timezone conversions, and millisecond rounding, which was diagnosed through code review, AI analysis, and batch testing, then fixed by normalising nanoseconds or adjusting database column precision.

JavaPostgreSQLTimezone
0 likes · 11 min read
Why Adding 2 Days Sometimes Results in a 3-Day Unblock? Java Date Precision Explained
php Courses
php Courses
Aug 14, 2025 · Backend Development

Master PHP Time Functions: Get, Format, Calculate, and Set Timezones

This tutorial explains how to use PHP's time(), date(), strtotime(), and date_default_timezone_set() functions to retrieve the current timestamp, format dates, perform date arithmetic, and configure timezones, providing practical code examples for each operation.

Date FormattingPHPTimezone
0 likes · 4 min read
Master PHP Time Functions: Get, Format, Calculate, and Set Timezones
Java Tech Enthusiast
Java Tech Enthusiast
Apr 23, 2025 · Databases

Choosing the Right Date/Time Storage in MySQL and PostgreSQL

When storing dates in MySQL or PostgreSQL, avoid VARCHAR fields and select between DATETIME (no time‑zone, larger range) and TIMESTAMP (UTC conversion, smaller range) based on whether automatic time‑zone handling and the 2038 limit suit your application, with Unix timestamps as a high‑performance alternative.

Timezonedatabasedatetime
0 likes · 11 min read
Choosing the Right Date/Time Storage in MySQL and PostgreSQL
IT Services Circle
IT Services Circle
Apr 22, 2025 · Backend Development

Effective Date and Time Handling in Java: Pitfalls, Thread Safety, and Advanced Solutions

This article explores common pitfalls in Java date handling such as thread‑unsafe SimpleDateFormat and daylight‑saving issues, and presents robust solutions including ThreadLocal wrappers, Java 8 Date‑Time API, timezone‑aware calculations, caching strategies, and global interceptor designs to ensure safe, performant, and maintainable time processing.

JavaThreadSafetyTimezone
0 likes · 10 min read
Effective Date and Time Handling in Java: Pitfalls, Thread Safety, and Advanced Solutions
Su San Talks Tech
Su San Talks Tech
Apr 22, 2025 · Backend Development

Avoid Date Bugs: Thread‑Safe Formatting and Time‑Zone Mastery in Java

This article explores common pitfalls in Java date handling—such as non‑thread‑safe formatting and daylight‑saving‑time errors—and presents robust solutions using ThreadLocal, the Java 8 Date/Time API, zone‑aware calculations, caching, and global interceptor patterns to ensure correct, high‑performance time processing in backend systems.

BackendDate FormattingJava 8
0 likes · 7 min read
Avoid Date Bugs: Thread‑Safe Formatting and Time‑Zone Mastery in Java
Liangxu Linux
Liangxu Linux
Apr 6, 2025 · Operations

Set Linux Timezone to CST (Asia/Shanghai) with timedatectl and Manual Links

Learn step-by-step how to change a Linux system’s timezone to China Standard Time (CST, Asia/Shanghai) using the modern timedatectl command, creating a symbolic link to /etc/localtime, or setting the TZ environment variable for temporary adjustments, with verification commands and important cautions.

CSTLinuxTimezone
0 likes · 4 min read
Set Linux Timezone to CST (Asia/Shanghai) with timedatectl and Manual Links
MaGe Linux Operations
MaGe Linux Operations
Feb 11, 2025 · Operations

How to Set Linux Timezone to CST (Asia/Shanghai) in Minutes

This guide explains three methods to change a Linux system's timezone to China Standard Time (CST, Asia/Shanghai), covering the recommended timedatectl command, manual /etc/localtime linking, and a temporary TZ environment variable, with step‑by‑step commands and verification tips.

Asia/ShanghaiCSTTimezone
0 likes · 4 min read
How to Set Linux Timezone to CST (Asia/Shanghai) in Minutes
Ops Development & AI Practice
Ops Development & AI Practice
Apr 25, 2024 · Cloud Native

How to Keep Docker Containers in Sync with Host Timezone

This guide explains why Docker containers default to UTC, then walks through three practical ways—mounting host timezone files, setting the TZ environment variable, and using timedatectl or scripts—to ensure container time matches the host for reliable logging and scheduling.

ContainerDevOpsDocker
0 likes · 4 min read
How to Keep Docker Containers in Sync with Host Timezone
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.

BackendDateFormattingJava
0 likes · 10 min read
Common Java Date Handling Pitfalls: Leap Year, Formatting, Timezone, and Thread Safety
FunTester
FunTester
Feb 21, 2024 · Backend Development

Common Time-Related Bugs and Protection Strategies

This article analyzes six typical time‑related bugs—including timezone conversion, daylight‑saving anomalies, precision mismatches, comparison errors, storage pitfalls, and permission expirations—and provides concrete design and testing safeguards for developers.

Backend DevelopmentSoftware TestingTimezone
0 likes · 10 min read
Common Time-Related Bugs and Protection Strategies
Bilibili Tech
Bilibili Tech
Aug 18, 2023 · Frontend Development

Common Time-Related Bugs and Protection Strategies in Software Development

The article reviews six common time‑related bugs—conversion, DST, precision, comparison, storage, and permission errors—explains their causes such as mismatched zones, outdated DST data, unit mismatches, overflow, and expired windows, and recommends development, testing, and operational safeguards like UTC normalization, unit definitions, proper data types, and monitoring.

Software TestingTime BugsTimezone
0 likes · 11 min read
Common Time-Related Bugs and Protection Strategies in Software Development
ByteFE
ByteFE
Jan 9, 2023 · Frontend Development

Understanding JavaScript Date Handling and Comparing Popular Date Libraries

This article examines why native JavaScript Date falls short for time handling, explains time measurement standards and time zones, and compares four major date libraries—MomentJS, DayJS, date-fns, and native Date—highlighting their advantages, drawbacks, and appropriate usage scenarios.

DayjsJavaScriptMomentJS
0 likes · 12 min read
Understanding JavaScript Date Handling and Comparing Popular Date Libraries
Open Source Linux
Open Source Linux
Dec 28, 2022 · Cloud Native

Essential Docker Image Building Hacks to Shrink Size and Speed Up Builds

Learn practical Dockerfile optimization techniques—including clean build contexts, choosing minimal base images, configuring Chinese mirrors, setting time zones, consolidating RUN commands, using virtual build environments, and minimizing layers—to dramatically reduce image size and improve build efficiency.

AlpineContainerDocker
0 likes · 16 min read
Essential Docker Image Building Hacks to Shrink Size and Speed Up Builds
Programmer DD
Programmer DD
Sep 21, 2022 · Backend Development

Why Does Java’s Date Show an 8‑Hour Shift? Uncovering Timezone Pitfalls

An online promotion that should end at 23:59:59 displayed as finished early due to an 8‑hour discrepancy, traced through HTTP packet capture, DB fields, and Java’s Date handling, revealing that Date objects use the local timezone while timestamps are based on UTC, causing mismatched calculations.

DebuggingJavaTime Conversion
0 likes · 8 min read
Why Does Java’s Date Show an 8‑Hour Shift? Uncovering Timezone Pitfalls
Java Backend Technology
Java Backend Technology
Aug 26, 2022 · Fundamentals

10 Common Java Date API Pitfalls and How to Avoid Them

This article lists ten frequent mistakes when using Java's date and time APIs—such as misusing Calendar fields, wrong format patterns, thread‑unsafe SimpleDateFormat, and daylight‑saving quirks—and provides clear corrected examples and best‑practice solutions.

CalendarSimpleDateFormatTimezone
0 likes · 12 min read
10 Common Java Date API Pitfalls and How to Avoid Them
Programmer DD
Programmer DD
Aug 25, 2022 · Databases

Why MySQL JDBC Driver Misinterprets CST and How to Fix the 13‑Hour Time Shift

This article investigates a puzzling 13‑hour time discrepancy caused by the MySQL 8.x JDBC driver interpreting the ambiguous CST timezone as America/Chicago, explains the underlying driver code and JDK timezone mappings, and provides multiple practical solutions including server settings, driver parameters, and official fixes.

CSTJDBCJava
0 likes · 17 min read
Why MySQL JDBC Driver Misinterprets CST and How to Fix the 13‑Hour Time Shift
Efficient Ops
Efficient Ops
Jul 14, 2022 · Operations

Essential Docker Image Building Tips to Shrink Size and Speed Up Builds

This article presents practical Dockerfile optimization techniques—including clean build contexts, lightweight base images, regional package mirrors, timezone configuration, virtual build environments, and layer minimization—to dramatically reduce image size and improve build efficiency.

AlpineDockerfileTimezone
0 likes · 15 min read
Essential Docker Image Building Tips to Shrink Size and Speed Up Builds
Aikesheng Open Source Community
Aikesheng Open Source Community
Dec 6, 2021 · Databases

MySQL Time Zone Configuration: Installation Standards, Session Variables, and Their Impact on Data

This article explains how to set the correct time zone for MySQL during installation, describes the relevant startup parameters and system variables, demonstrates their effect on functions like NOW() and TIMESTAMP columns, and provides practical solutions for Java applications, data migration, and dump utilities.

ConfigurationTimezonedatabase
0 likes · 11 min read
MySQL Time Zone Configuration: Installation Standards, Session Variables, and Their Impact on Data
MaGe Linux Operations
MaGe Linux Operations
Oct 11, 2021 · Fundamentals

Master Python’s Time and Date Modules: From time to datetime, pytz, and Arrow

This comprehensive guide walks you through Python’s time‑handling ecosystem, covering the low‑level time module, the richer datetime module, timezone utilities like pytz, advanced parsing with dateutil, and the user‑friendly Arrow library, complete with explanations, code snippets, and practical examples for formatting, conversion, and manipulation.

ArrowPythonTimezone
0 likes · 39 min read
Master Python’s Time and Date Modules: From time to datetime, pytz, and Arrow
Python Programming Learning Circle
Python Programming Learning Circle
Sep 10, 2021 · Fundamentals

Comprehensive Guide to Python Time Handling: time, datetime, pytz, dateutil, and Arrow

This article provides a detailed overview of Python's time‑handling ecosystem, covering fundamental concepts of seconds, GMT, UTC and leap seconds, the low‑level time module, high‑level datetime classes, timezone manipulation with pytz, flexible parsing with dateutil, and the user‑friendly Arrow library, complete with code examples and usage notes.

ArrowTimezonedatetime
0 likes · 24 min read
Comprehensive Guide to Python Time Handling: time, datetime, pytz, dateutil, and Arrow
DevOps Cloud Academy
DevOps Cloud Academy
Aug 29, 2021 · Operations

Handling Timezone and System Time Issues in Linux Containers and Kubernetes

This article explains the differences between hardware and system clocks, how Linux manages time zones, why container images often have incorrect default time zones, and provides multiple practical methods—including Dockerfile settings, volume mounts, environment variables, PodPreset, and libfaketime—to correctly set or adjust time in Docker and Kubernetes environments.

ContainerDockerKubernetes
0 likes · 13 min read
Handling Timezone and System Time Issues in Linux Containers and Kubernetes
Java Backend Technology
Java Backend Technology
Jun 3, 2021 · Databases

Why MySQL TIMESTAMP Is a Hidden Pitfall and How to Avoid It

This article explains MySQL's three time types, highlights the quirks and automatic defaults of TIMESTAMP—including the 2038 problem, high‑concurrency issues, and unexpected behavior in non‑strict mode—provides practical examples, and offers guidance on configuring server variables or switching to DATETIME for safer handling.

2038 problemSQLTimezone
0 likes · 11 min read
Why MySQL TIMESTAMP Is a Hidden Pitfall and How to Avoid It
Programmer DD
Programmer DD
May 7, 2021 · Fundamentals

Master Java 8 Date & Time API: Practical Examples and Tips

This article introduces Java 8's new date‑time API, explains its advantages over the old java.util.Date and SimpleDateFormat, lists the essential classes such as Instant, LocalDate, LocalTime, ZonedDateTime, and provides step‑by‑step code examples for common operations like getting the current date, manipulating specific dates, handling time zones, and formatting.

JavaJava 8Timezone
0 likes · 20 min read
Master Java 8 Date & Time API: Practical Examples and Tips
Python Programming Learning Circle
Python Programming Learning Circle
Dec 15, 2020 · Backend Development

Understanding Timezone Handling in Django

This article explains the differences between naive and aware datetime objects, how Django sets the TZ environment variable, the behavior of datetime.now, timezone.now, and related Python functions, and provides practical guidance for storing and converting timestamps in Django applications.

BackendDjangoPython
0 likes · 14 min read
Understanding Timezone Handling in Django
JavaEdge
JavaEdge
Nov 22, 2020 · Fundamentals

Why Java’s Legacy Date API Fails and How Java 8 Solves Time‑Zone Chaos

The article examines the shortcomings of Java’s pre‑Java 8 date‑time classes—Date, Calendar, and SimpleDateFormat—highlighting their thread‑unsafe, confusing APIs and time‑zone pitfalls, then demonstrates how Java 8’s new date‑time API (LocalDateTime, ZonedDateTime, ZoneId, DateTimeFormatter) provides clear, thread‑safe handling and proper internationalization.

JavaTimezonedatetime
0 likes · 9 min read
Why Java’s Legacy Date API Fails and How Java 8 Solves Time‑Zone Chaos
Programmer DD
Programmer DD
May 30, 2020 · Databases

Which Date/Time Type Should You Use in Databases? A Practical Guide

This article examines common date and time storage options in databases—string, DateTime, Timestamp, and Unix timestamp—highlighting their characteristics, timezone handling, performance implications, and best-use scenarios, with Java code examples and migration tips.

Timezonedatetimetimestamp
0 likes · 7 min read
Which Date/Time Type Should You Use in Databases? A Practical Guide
Java Captain
Java Captain
Mar 14, 2020 · Fundamentals

Design of the Java Platform Time System

This article explains the design of Java's time system, covering the epoch start, offset representation, timezone handling, historical changes, and the modern Java 8 date‑time API with practical code examples and usage guidelines.

APIJavaTimezone
0 likes · 26 min read
Design of the Java Platform Time System
Sohu Tech Products
Sohu Tech Products
Nov 13, 2019 · Backend Development

Understanding Date and Time Handling in Java: From System.currentTimeMillis to Java 8 Date/Time API

This article explains the physical and philosophical notions of time, the challenges of representing time in computing, and provides a comprehensive guide to Java's date‑time APIs—including System.currentTimeMillis, System.nanoTime, java.util.Date, java.sql.Timestamp, Calendar, SimpleDateFormat, and the modern Java 8 classes such as Instant, LocalDate/Time, ZonedDateTime, and DateTimeFormatter—while highlighting common pitfalls and best practices.

Timezonedatetimejava8
0 likes · 23 min read
Understanding Date and Time Handling in Java: From System.currentTimeMillis to Java 8 Date/Time API
Programmer DD
Programmer DD
Sep 16, 2019 · Databases

Why MySQL DATETIME Misses Milliseconds: Connector Bugs and Practical Fixes

This article explores common MySQL DATETIME timestamp precision issues caused by mismatched mysql‑connector‑java and server versions, demonstrates three practical solutions, and provides a step‑by‑step case study with code examples to help developers choose the right time field type and avoid timezone pitfalls.

JavaTimezonemysql
0 likes · 7 min read
Why MySQL DATETIME Misses Milliseconds: Connector Bugs and Practical Fixes