A time processing method and apparatus

By converting the target time data type in the software code to a preset time data type and using NTP timestamps to determine the current time for time synchronization, the problem of the software not working properly after 2038 was solved, and the normal operation and time extension of the software were achieved.

CN116149426BActive Publication Date: 2025-10-28CHINA TECHENERGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310026519.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-09
Publication Date
2025-10-28
Estimated Expiration
2043-01-09

AI Technical Summary

Technical Problem

In existing technologies, the software will not function properly after 2038, and time rollover issues will occur when using the Network Time Protocol (NTP), preventing the software's lifespan from being extended.

Method used

The target time data type in the software code is converted to a preset time data type, the Network Time Protocol (NTP) timestamp is obtained, and it is compared with the preset time to determine the current time. The application system is then synchronized with the current time.

Benefits of technology

This avoids modifications to the data structure, resolves the issue of the software failing to function properly after 2038, and avoids time processing problems caused by NTP time flipping, enabling the software to run normally and extending its lifespan.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116149426B_ABST
    Figure CN116149426B_ABST
Patent Text Reader

Abstract

This application discloses a time processing method and apparatus. In this method, a target time data type in the software code is converted to a preset time data type; a Network Time Protocol (NTP) timestamp is obtained; the NTP time corresponding to the NTP timestamp is compared with the preset time to determine the current time, where the preset time is greater than the initial NTP time; and the application system corresponding to the software is synchronized with the current time. Therefore, this method both converts the target time data type in the software code to a preset time data type that supports times after 2038 and compares the obtained NTP timestamp with the preset time to determine the correct current time for synchronization. This avoids modifying other data structures and avoids directly determining the NTP time corresponding to the NTP timestamp as the current time for synchronization. Instead, it performs time processing based on the preset time data type and the correct current time, ensuring the software runs normally and extending its lifespan.
Need to check novelty before this filing date? Find Prior Art