Tagged articles
timezone
56 articles · Page 1 of 1
This article explains the MySQL 8.0.22 timezone bug that causes timestamp discrepancies up to 13 hours, details JDBC driver parameters like serverTimezone, connectionTimeZone, preserveInstants, and forceConnectionTimeZoneToSession, and provides seven best practices for correct timezone configuration in Java applications.
Best PracticesConnector/JDATETIME
0 likes · 16 min read

This article analyzes MySQL Connector/J's timezone handling changes from 5.1 to 8.x, details the official bug #30962953 affecting versions 8.0.0-8.0.22, explains key parameters like serverTimezone and preserveInstants, and provides best practices for correct timestamp storage and retrieval.
Best PracticesConnector/JDATETIME
0 likes · 16 min read

This article details MySQL Connector/J's timezone handling bug in versions 8.0.0-8.0.22, explains key JDBC parameters like serverTimezone and preserveInstants, and provides best-practice configurations to avoid timestamp shifts and zero-date errors when upgrading from MySQL 5.1.
Best PracticesConnector/JDATETIME
0 likes · 16 min read

This article introduces the Carbon library—a fluent, human‑readable wrapper for PHP's DateTime—explaining why it simplifies date calculations, how to install it via Composer, and demonstrating core concepts, common APIs, advanced features, and performance best practices with concrete code examples.
CarbonDATETIMEFluent API
0 likes · 9 min read

A Java backend service was unexpectedly showing a three‑day unblocking date instead of two, due to a one‑second overflow when converting LocalDateTime to java.util.Date for a PostgreSQL timestamp column, and the article walks through diagnosis, replication, and two practical fixes.
BackendDATETIMEJava
0 likes · 10 min read

This article compares MySQL's INT, TIMESTAMP, and DATETIME column types, explaining their limits, default behaviors, timezone handling, performance implications, and best‑practice recommendations for storing temporal data in modern applications.
DATETIMEMySQLSQL
0 likes · 7 min read

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.
DATETIMEJavaPostgreSQL
0 likes · 11 min read

Learn step-by-step how to change a Linux system’s timezone to China Standard Time (CST, GMT+8) using the timedatectl command, manually linking /etc/localtime, or setting the TZ environment variable, including verification commands and important considerations.
CSTtimedatectltimezone
0 likes · 4 min read

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.
DATETIMEPHPdate-formatting
0 likes · 4 min read

This guide shows how to configure Ubuntu to use the Shanghai time zone with timedatectl, synchronize the clock via Alibaba Cloud's NTP server, write the current time to the BIOS using hwclock, and verify the settings with date -R, ensuring accurate time after reboots.
Ubuntuhwclockntpdate
0 likes · 2 min read

This article explains why storing dates as strings is inefficient, compares MySQL DATETIME and TIMESTAMP—including storage size, range, timezone handling, and performance—and discusses when to use numeric Unix timestamps or PostgreSQL equivalents for reliable time data management.
DATETIMEMySQLdatabase
0 likes · 14 min read

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.
DATETIMEMySQLdatabase
0 likes · 11 min read

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.
DATETIMEJavaThreadSafety
0 likes · 10 min read

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.
BackendJava 8date-formatting
0 likes · 7 min read

This guide explains three ways to change a Linux system's timezone to China Standard Time (CST, GMT+8) – using the timedatectl command, manually linking /etc/localtime, and setting the TZ environment variable for temporary adjustments.
Asia/ShanghaiCSTsystem administration
0 likes · 4 min read

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.
CSTLinuxtimedatectl
0 likes · 4 min read

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/ShanghaiCSTtimedatectl
0 likes · 4 min read

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.
DevOpsDockerDocker Compose
0 likes · 4 min read

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.
BackendDATETIMEDateFormatting
0 likes · 10 min read

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 developmentdate bugssoftware testing
0 likes · 10 min read

This article explains how to use PHP's timestamp functions—including time(), strtotime(), date(), and mktime()—to obtain current timestamps, convert strings to timestamps, format dates, handle time zones, and perform relative time calculations with practical code examples.
Datestrtotimetime
0 likes · 5 min read

This article explains how to use PHP's time‑related functions—including time(), date(), strtotime(), and date_default_timezone_set()—to obtain the current timestamp, format dates, perform date arithmetic, and configure timezones, providing clear code examples for each operation.
PHPdate()strtotime()
0 likes · 5 min read

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.
Time Bugsdstfrontend
0 likes · 11 min read

This article introduces the Python dateutil library, showing how to install it, parse various date strings, perform date arithmetic with relativedelta, handle time zones, format dates, compute intervals, parse ISO strings, and generate recurring events through clear code examples.
DATETIMEDateUtilparsing
0 likes · 8 min read

This article explains how to configure Nginx to split access logs by day using the $time_iso8601 variable, align log timestamps with the local timezone via Docker‑Compose or Dockerfile settings, and introduces the GoAccess tool for visual log analysis.
BackendDockerGoAccess
0 likes · 5 min read


ByteFEJan 9, 2023 · Frontend Development
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.
DateDayjsJavaScript
0 likes · 12 min read

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.
AlpineDockerDockerfile
0 likes · 16 min read

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.
DateDebuggingJava
0 likes · 8 min read

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.
DateSimpleDateFormatcalendar
0 likes · 12 min read

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

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.
AlpineDockerfileVirtual Build Environment
0 likes · 15 min read

A Java program that formats "1900-01-01 08:00:00" unexpectedly prints "1900-01-01 08:05:43" due to historic Shanghai timezone offsets, and the article walks through the bug, related OpenJDK issues, Stack Overflow cases, and how different TZDB releases affect the result.
DATETIMEJDK bugJava
0 likes · 9 min read

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.
ConfigurationMySQLdatabase
0 likes · 11 min read

The article explains a mysterious Java date‑formatting bug where parsing "1900-01-01 08:00:00" with SimpleDateFormat yields "1900-01-01 08:05:43", tracing the cause to historic Shanghai timezone offsets and changes in the IANA TZ database across JDK versions.
DATETIMEJDK bugJava
0 likes · 9 min read

An intriguing Java date‑parsing bug shows a 5 minute 43 second offset when formatting the year 1900, caused by historic Shanghai timezone offsets and changes in the TZDB; the article walks through code examples, bug reports, and the evolution of timezone data that explain this anomaly.
JDK bugSimpleDateFormatTZDB
0 likes · 9 min read

A colleague reported that a MyBatis insert stored a timestamp from the previous day, leading to a deep investigation that revealed mismatched timezone handling between MySQL, the JDBC driver, and Java, and presented two practical fixes to align all components.
DebuggingJavaMyBatis
0 likes · 15 min read

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.
ArrowDATETIMEDateUtil
0 likes · 39 min read

This article explains why JavaScript's Date constructor treats ISO‑8601 date‑only strings as UTC but interprets other date formats using the local time zone, detailing V8's parsing logic and showing example outputs in Node.js.
DateISO8601Node.js
0 likes · 4 min read

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.
ArrowDATETIMEDateUtil
0 likes · 24 min read

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.
DockerKubernetesLinux
0 likes · 13 min read

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 problemMySQLSQL
0 likes · 11 min read

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.
INSTANTJavaJava 8
0 likes · 20 min read

This article explains the PHP date_default_timezone_set() function, detailing its purpose of setting a default timezone for all date/time functions, the required timezone identifier parameter, the boolean return values, and provides a practical code example with expected output.
PHPdate_default_timezone_setphp-functions
0 likes · 2 min read

The article explains PHP's date_default_timezone_get() function, detailing how it determines the default timezone—first checking any timezone set with date_default_timezone_set(), then the php.ini setting, and finally the system default—provides the return type, example code, and sample output.
date-timephp-functionstimezone
0 likes · 2 min read

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.
BackendDATETIMEDjango
0 likes · 14 min read

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.
DATETIMEJavaJava8
0 likes · 9 min read

This article provides a comprehensive overview of Python's three core time modules—datetime, time, and calendar—explaining their design, key concepts like epoch, UTC, DST, and demonstrating essential APIs for retrieving, converting, and manipulating dates and times.
DATETIMEPythondate handling
0 likes · 13 min read

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.
DATETIMEtimestamptimezone
0 likes · 7 min read

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.
APIDATETIMEJava
0 likes · 26 min read

This article provides a comprehensive overview of Python's time‑related modules—datetime, time, and calendar—explaining their design, key concepts like epoch, UTC, DST, and practical APIs for obtaining, converting, and manipulating dates and times.
DATETIMEPythondst
0 likes · 13 min read

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.
DATETIMEJava8timestamp
0 likes · 23 min read

The article explains a 14‑hour discrepancy between MySQL's created_time and recovery_time timestamps, analyzes JVM and driver timezone settings, traces MyBatis and MySQL driver conversions, and provides practical fixes by adjusting MySQL server and JDBC URL timezones.
JDBCMyBatisMySQL
0 likes · 7 min read

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.
JavaMySQLmysql-connector-java
0 likes · 7 min read

This article presents a straightforward Java solution that converts UTC timestamps to Beijing time by applying an 8‑hour offset and provides utility methods to retrieve the current week number, month, day, and year using the Calendar class.
BackendUTCcalendar
0 likes · 3 min read

This article provides a comprehensive overview of Python’s three core time-handling modules—time, datetime, and calendar—explaining key concepts such as epoch, UTC/GMT, time zones, DST, and demonstrating how to retrieve, format, and convert dates and times using their APIs.
DATETIMEdate handlingdst
0 likes · 13 min read

This article explains how MySQL stores dates in UTC, why Sequelize returns UTC values despite a configured timezone, and demonstrates using custom getter methods (with moment) to automatically format DATE fields, including an advanced approach to apply the getter across multiple models.
MySQLNode.jsORM
0 likes · 4 min read
