CN111399916A - Time conversion method, device, equipment and storage medium - Google Patents

Time conversion method, device, equipment and storage medium Download PDF

Info

Publication number
CN111399916A
CN111399916A CN202010131176.6A CN202010131176A CN111399916A CN 111399916 A CN111399916 A CN 111399916A CN 202010131176 A CN202010131176 A CN 202010131176A CN 111399916 A CN111399916 A CN 111399916A
Authority
CN
China
Prior art keywords
time
time zone
zone
utc
attribute
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202010131176.6A
Other languages
Chinese (zh)
Inventor
王文志
张国磊
朱英澍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010131176.6A priority Critical patent/CN111399916A/en
Publication of CN111399916A publication Critical patent/CN111399916A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Abstract

The application discloses a time conversion method, which is applied to a Basic Input Output System (BIOS), and comprises the following steps: reading UTC time in an RTC register through an interrupt program; converting the UTC time according to the current time zone to obtain the time with the time zone attribute; the time with the time zone attribute is displayed in the configuration interface of the BIOS. By applying the technical scheme provided by the embodiment of the application, the international standard time can be converted to different time zones on the premise of not influencing the UTC time stored by the RTC register, so that the time displayed in the configuration interface of the BIOS keeps consistent with the time of the operating system, misleading to a user is avoided, further operation and configuration of the user are facilitated, and the use experience of the user can be improved. The application also discloses a time conversion device, equipment and a storage medium, and the time conversion device, the equipment and the storage medium have corresponding technical effects.

Description

Time conversion method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer application technologies, and in particular, to a time conversion method, apparatus, device, and storage medium.
Background
At present, chip design and development environments based on an X86 System gradually mature, and the conventional BIOS (basic input Output System) gradually exits from the history stage due to the introduction of UEFI (unified extensible Firmware Interface). UEFI is a popular BIOS implementation framework at present, EDK (Embedded Development Kit) is used as a first set of code implementation of the UEFI framework, is widely recognized, and provides a better standard for definitions of various interfaces based on EDK written by the UEFI standard.
The BIOS implemented based on UEFI can be viewed as a lightweight operating system to some extent, and a user can go down to the lightweight operating system to complete the configuration of many interfaces, the setting of the user, the setting of switches, and the like. In order to fully embody the convenience and the friendliness of BIOS setting, a set of universal interface implementation modes are defined by the UEFI standard, and developers can develop according to the UEFI standard.
Most manufacturers develop interfaces according to similar standards when displaying the interfaces, and the first interface to be displayed is generally defined as a Main interface and mainly displays basic information of a current product, such as a CPU (Central processing Unit) model, a product model, system basic time and the like. This basic information, while relatively basic, is important.
The System base Time is generally directly read and displayed by a BIOS from an RTC (Real Time Clock) register of a Central Processing Unit (CPU), and in order to adapt to a requirement for switching a plurality of Time zones of the CPU and an Operating System (OS) at will, the Time in the RTC register must be set to an international standard Time (UTC), which results in that the System base Time displayed in a configuration interface of the BIOS can only be the UTC Time.
Therefore, the time displayed in the configuration interface of the BIOS is inconsistent with the time displayed under the operating system, misleading is easily caused to a user, and inconvenience is easily brought to the further operation or configuration of the user.
Disclosure of Invention
The application aims to provide a time conversion method, a time conversion device and a storage medium, so that the time displayed in a configuration interface of a BIOS is consistent with the time under an operating system, misleading to a user is avoided, and the further operation and configuration of the user are facilitated.
In order to solve the technical problem, the application provides the following technical scheme:
a time conversion method is applied to a Basic Input Output System (BIOS), and comprises the following steps:
reading UTC time in an RTC register through an interrupt program;
converting the UTC time according to the current time zone to obtain time with time zone attributes;
and displaying the time with the time zone attribute in a configuration interface of the BIOS.
In a specific embodiment of the present application, the converting the UTC time according to a time zone set by a user to obtain a time with a time zone attribute includes:
determining a first time compensation value of the UTC time relative to the current time zone according to the current time zone, wherein the unit of the first time compensation value is second;
determining a first delta value of the UTC time compared to an initial 0 time, the first delta value having a unit of seconds;
and converting the time with the time zone attribute into a time format based on the initial 0 time after adding the first time compensation value to the first increment value.
In a specific embodiment of the present application, the current time zone is: and the user sets the time zone selected by the switch through the time zone under the BIOS.
In a specific embodiment of the present application, after displaying the time with time zone attribute in the configuration interface of the BIOS, the method further includes:
receiving a modification instruction of the time with the time zone attribute from a user;
determining modified target time according to the modification instruction;
converting the target time according to the corresponding time zone of the time with the time zone attribute to obtain the time without the time zone attribute;
storing the time without the time zone attribute as the UTC time in the RTC register.
In a specific embodiment of the present application, the converting the target time according to the corresponding time zone of the time with the time zone attribute to obtain the time without the time zone attribute includes:
determining a second time compensation value of the corresponding time zone relative to the UTC time according to the corresponding time zone of the time with the time zone attribute, wherein the unit of the second time compensation value is second;
determining a second increment value of the target time compared to an initial 0 time, the second increment value having a unit of seconds;
converting to a time without a time zone attribute in a time format based on the initial 0 time after adding the second time offset value to the second delta value.
A time conversion device applied to a Basic Input Output System (BIOS), the device comprising:
the time reading module is used for reading the UTC time in the RTC register through the interrupt program;
the time conversion module is used for converting the UTC time according to the current time zone to obtain the time with the time zone attribute;
and the time display module is used for displaying the time with the time zone attribute in the configuration interface of the BIOS.
In a specific embodiment of the present application, the time conversion module is configured to:
determining a first time compensation value of the UTC time relative to the current time zone according to the current time zone, wherein the unit of the first time compensation value is second;
determining a first delta value of the UTC time compared to an initial 0 time, the first delta value having a unit of seconds;
and converting the time with the time zone attribute into a time format based on the initial 0 time after adding the first time compensation value to the first increment value.
In a specific embodiment of the present application, the apparatus further includes a time writing module, configured to:
after the time with the time zone attribute is displayed in the configuration interface of the BIOS, receiving a modification instruction of a user for the time with the time zone attribute;
determining modified target time according to the modification instruction;
converting the target time according to the corresponding time zone of the time with the time zone attribute to obtain the time without the time zone attribute;
storing the time without the time zone attribute as the UTC time in the RTC register.
A time conversion apparatus comprising:
a memory for storing a computer program;
a processor for implementing the steps of any of the above time conversion methods when executing the computer program.
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the above-described time-conversion methods.
By applying the technical scheme provided by the embodiment of the application, the BIOS reads the UTC time in the RTC register through the interrupt program, can convert the UTC time according to the current time zone to obtain the time with the time zone attribute, and displays the time with the time zone attribute in the configuration interface of the BIOS. Therefore, the international standard time can be converted to the time of different time zones on the premise of not influencing the UTC time stored by the RTC register, so that the time displayed in the configuration interface of the BIOS keeps consistent with the time of the operating system, misleading to a user is avoided, the further operation and configuration of the user are facilitated, and the use experience of the user can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a basic flow chart of a prior art BIOS reading and displaying time;
FIG. 2 is a flowchart illustrating an implementation of a time conversion method according to an embodiment of the present application;
FIG. 3 is a diagram illustrating the UTC time to time zone conversion process in the embodiment of the present application;
FIG. 4 is a process diagram of converting time zone time to UTC time in an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a time conversion apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a time conversion device in an embodiment of the present application.
Detailed Description
Currently, as shown in fig. 1, the original implementation flow for the BIOS to read and display time is roughly: the method comprises the steps that after power-on, basic initialization action of a BIOS on a CPU is completed, in the initialization process, the BIOS detects whether a latest RTC time value is written in a non-volatile storage unit CMOS or not, if the latest RTC time value is not written, basic time, namely an initial value, prefabricated in a BIOS code is written into the CMOS and an RTC register at the same time, then a corresponding timer interrupt function is registered, current UTC time is read from the RTC register continuously and displayed in a BIOS configuration interface, if the latest UTC time value is written, current time is read from the CMOS to the RTC register, then the corresponding timer interrupt function is registered, and current UTC time is read from the RTC register continuously and displayed in the BIOS configuration interface. And after the UTC time is displayed in the BIOS configuration interface, exiting the BIOS interface to start the OS.
Because the time in the RTC register must be international standard time, and when the time setting is performed by each large manufacturer referring to the UEFI standard at present, the year, month, day and hour, minute and second are set separately, and there is no correlation, so that the time displayed in the configuration interface of the BIOS by most manufacturers at present is UTC time, and the OS generally performs time zone compensation according to the time zone in which the user is located, so that the system time seen by the user can correspond to the actual time of the current area one to one, but the time displayed in the configuration interface of the BIOS is different from the time with the time zone attribute in the OS, which easily causes misleading to the user, easily causes inconvenience to further operation or configuration of the user, and affects user experience.
Based on the problems, the application provides a time conversion method, so that the functions of the BIOS are enriched, the design rigor of the product is improved, the time displayed in the configuration interface of the BIOS can be kept consistent with the time under the operating system, misleading to a user is avoided, and the further operation and configuration of the user are facilitated.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 2, a flowchart of an implementation of a time transition method provided in an embodiment of the present application, where the method may be applied to a BIOS, may include the following steps:
s210: the UTC time in the RTC register is read by the interrupt routine.
The time value in the RTC register is UTC time. In the embodiment of the present application, the BIOS may read the UTC time in the RTC register through the interrupt program. The interrupt routine may read the UTC time in the RTC register once every 1 second.
S220: and converting the UTC time according to the current time zone to obtain the time with the time zone attribute.
The current time zone can be the time zone where the current location is actually located, or can be other time zones set by the current user.
A time zone setting switch can be arranged in the BIOS configuration interface, and a user can select the time zone of the time to be displayed through the time zone setting switch, wherein the range can be from eight west areas to eight east areas. Namely, the current time zone is the time zone selected by the user through the time zone setting switch under the BIOS.
According to the current time zone, the time zone to which the time displayed on the BIOS configuration interface is to be converted can be known, so that the UTC time read from the RTC register can be converted, and the time with the time zone attribute can be obtained.
In a specific embodiment of the present application, the step S220 may include the following steps:
the method comprises the following steps: determining a first time compensation value of UTC time relative to the current time zone according to the current time zone, wherein the unit of the first time compensation value is second;
step two: determining a first incremental value of UTC time compared with initial 0 time, wherein the unit of the first incremental value is second;
step three: and converting the time into the time with the time zone attribute in the time format based on the initial 0 time after adding the first time compensation value to the first increment value.
For convenience of description, the above three steps are combined for illustration.
In an embodiment of the present application, a first time offset value of the UTC time relative to the current time zone may be determined according to the current time zone. The first time offset value has a unit of seconds. If the current time zone is the east x zone, the first time compensation value is 60 x seconds, and if the current time zone is the west x zone, the first time compensation value is-60 x seconds. For example, the current time zone is the east eight zone, and the first time offset value is 60 × 8 seconds, i.e., 8 hours.
After reading the UTC time in the RTC register by the interrupt routine, a first delta value of UTC time compared to the initial 0 time may be determined, the first delta value being in seconds.
The initial 0 time is the time that was initially written into the RTC register. The UTC time is incremented by a certain amount compared to the initial 0 time, and after the UTC time is read, a first increment value can be calculated.
For example, the initial 0 time is 2015/1/100: 00:00, and the currently read UTC time is 2015/1/200:00:00, which are compared to determine that the first incremental value of the UTC time compared to the initial 0 time is 24 hours, i.e., 60 × 24 seconds.
And after adding the first time compensation value to the first increment value, obtaining a time value with a time zone attribute, wherein the unit of the time value is second, and based on the initial 0 time, converting the time value into a time format, namely obtaining the time with the time zone attribute in the time format.
Assuming that the current time zone is an east eight zone, the first time compensation value is 60 × 8 seconds, the first increment value is 60 × 24 seconds, the first increment value is added with the first time compensation value to obtain 60 × 24+60 × 8, the time value is added on the basis of the initial 0 time, and the time is converted into the time with the time zone attribute in the time format.
When time zone conversion is performed on the read UTC time, conversion of time factors such as hours, years, months and days is involved, and conversion of some special time points needs to be considered, so that the process is complex. According to the embodiment of the application, the first incremental value and the first time compensation value are counted in seconds, so that the process is simplified, and the code implementation difficulty is reduced. The read UTC time can be quickly and accurately converted to time with a time zone attribute.
S230: the time with the time zone attribute is displayed in the configuration interface of the BIOS.
And converting the UTC time according to the current time zone, and displaying the time with the time zone attribute in a configuration interface of the BIOS after obtaining the time with the time zone attribute.
For convenience of understanding, the embodiment of the present application will be described by taking the process of converting UTC time into time zone time shown in fig. 3 as an example.
The BIOS can read the UTC time in an RTC register through an interrupt program, the format of the UTC time is Y/M/D h: M: s, a first increment value of the UTC time is determined to be compared with the initial 0 time, the time zone set by a user is judged to be x, if the time zone is an east zone, the time zone is +60 x on the first increment value, if the time zone is a west zone, the time zone is-60 x on the first increment value, then the time zone is converted into the time with the time zone attribute based on the initial 0 time, and finally the time with the time zone attribute is displayed on a configuration interface of the BIOS.
By applying the method provided by the embodiment of the application, the BIOS reads the UTC time in the RTC register through the interrupt program, can convert the UTC time according to the current time zone to obtain the time with the time zone attribute, and displays the time with the time zone attribute in the configuration interface of the BIOS. Therefore, the international standard time can be converted to the time of different time zones on the premise of not influencing the UTC time stored by the RTC register, so that the time displayed in the configuration interface of the BIOS keeps consistent with the time of the operating system, misleading to a user is avoided, the further operation and configuration of the user are facilitated, and the use experience of the user can be improved.
In an embodiment of the present application, after displaying the time with time zone attribute in the configuration interface of the BIOS in step S230, the method may further include the steps of:
the method comprises the following steps: receiving a modification instruction of a user to the time with the time zone attribute;
step two: determining modified target time according to the modification instruction;
step three: converting the target time according to the corresponding time zone of the time with the time zone attribute to obtain the time without the time zone attribute;
step four: the time without the time zone attribute is stored as UTC time in the RTC register.
For convenience of description, the above four steps are combined for illustration.
The configuration interface of the BIOS may provide a modification entry that the user may modify the time with the time zone attribute. When a modification instruction of the time with the time zone attribute by the user is received, the modified target time can be determined according to the modification instruction. The target time is still with a time zone attribute.
The target time is converted according to the corresponding time zone of the time with the time zone attribute, and the time without the time zone attribute can be obtained.
Specifically, a second time compensation value of the corresponding time zone relative to the UTC time may be determined according to the corresponding time zone of the time with the time zone attribute, a unit of the second time compensation value is second, a second increment value of the target time relative to the initial 0 time is determined, and the unit of the second increment value is second, and after the second increment value is added to the second time compensation value, the time without the time zone attribute is converted into the time format based on the initial 0 time.
In this embodiment, a second time compensation value of the corresponding time zone relative to the UTC time may be determined according to the corresponding time zone of the time with the time zone attribute, where the unit of the second time compensation value is second. If the current time zone is the east x zone, the second time compensation value is-60 x seconds, and if the current time zone is the west x zone, the second time compensation value is 60 x seconds. For example, the current time zone is the east eight zone, and the second time offset value is-60 × 8 seconds, i.e., -8 hours.
After determining the modified target time, a second increment value in seconds of the target time compared to the initial 0 time may be further determined.
Assume an initial 0 time of 2015/1/100: 00:00, a target time of 2015/1/209: 00:00, and a second increment value of 60 x 33 seconds.
Adding the second time offset value to the second delta value results in a time value without the time zone attribute, which is in seconds. Based on the initial 0 time, it can be converted to a time in time format, i.e., a time without a time zone attribute in time format can be obtained.
Assuming that the current time zone is the east eight zone, the second time compensation value is-60 × 8 seconds, the second increment value is 60 × 33 seconds, and adding the second time compensation value to the second increment value is 60 × 24-60 × 8, the time value is added on the basis of the initial 0 time, and the time is converted into the time without the time zone attribute in the time format.
For convenience of understanding, the embodiment of the present application will be described by taking the process of converting time zone time into UTC time as an example, as shown in fig. 4.
After the BIOS is started and enters a configuration interface of the BIOS, if a user carries out time modification setting, the time input by the user can be obtained, the modified target time is determined, the current time zone is judged to be x, if the current time zone is an east zone, 60 x is increased to a second increment value of the target time relative to the initial 0 time, if the current time zone is a west zone, 60 x is increased to a second increment value of the target time relative to the initial 0 time, then the time without the time zone attribute is converted into the time without the time format based on the initial 0 time and is written into an RTC register, and the BIOS can be quitted after the user saves the setting.
In the embodiment of the application, the time displayed in the configuration interface of the BIOS may have an interactive property, and a user may freely set the time displayed. This requires another layer of inverse conversion. Taking the time in the east eight zone as an example, the time seen by the user under the configuration interface of the BIOS is the time in the east eight zone, and the set time is also based on the east eight zone, but only the UTC time is stored in the RTC register after the set time is set, so that the conversion from the time in each zone of one layer to the UTC time is involved here. However, the implementation of time in the current BIOS is to set the year, month, day and hour, minute and second separately, and there is no association, so that the conversion of year, month, day and time due to the conversion in part cannot be implemented during the conversion. When the time modification setting is carried out, the reverse derivation of the algorithm is also adopted, the user takes the current time zone as a reference system, the set time has a time zone attribute, when the BIOS receives the target time modified by the user, the time is also subjected to incremental calculation relative to the initial 0 time, such as 2015/1/100: 00:00, and then the time compensation is removed according to the current time zone, so that accurate UTC time is obtained and finally stored in an RTC register.
Corresponding to the above method embodiments, the present application further provides a time conversion device, which is applied to a BIOS, and the time conversion device and the time conversion method described above may be referred to in correspondence.
Referring to fig. 5, the apparatus includes the following modules:
a time reading module 510, configured to read the UTC time in the RTC register through an interrupt program;
a time conversion module 520, configured to convert the UTC time according to the current time zone to obtain a time with a time zone attribute;
a time display module 530 for displaying the time with the time zone attribute in the configuration interface of the BIOS.
By applying the device provided by the embodiment of the application, the BIOS reads the UTC time in the RTC register through the interrupt program, can convert the UTC time according to the current time zone to obtain the time with the time zone attribute, and displays the time with the time zone attribute in the configuration interface of the BIOS. Therefore, the international standard time can be converted to the time of different time zones on the premise of not influencing the UTC time stored by the RTC register, so that the time displayed in the configuration interface of the BIOS keeps consistent with the time of the operating system, misleading to a user is avoided, the further operation and configuration of the user are facilitated, and the use experience of the user can be improved.
In one embodiment of the present application, the time conversion module 520 is configured to:
determining a first time compensation value of UTC time relative to the current time zone according to the current time zone, wherein the unit of the first time compensation value is second;
determining a first incremental value of UTC time compared with initial 0 time, wherein the unit of the first incremental value is second;
and converting the time into the time with the time zone attribute in the time format based on the initial 0 time after adding the first time compensation value to the first increment value.
In one embodiment of the present application, the current time zone is: the user sets the time zone selected by the switch through the time zone under the BIOS.
In a specific embodiment of the present application, the apparatus further includes a time writing module, configured to:
after displaying the time with the time zone attribute in a configuration interface of the BIOS, receiving a modification instruction of a user for the time with the time zone attribute;
determining modified target time according to the modification instruction;
converting the target time according to the corresponding time zone of the time with the time zone attribute to obtain the time without the time zone attribute;
the time without the time zone attribute is stored as UTC time in the RTC register.
In one embodiment of the present application, the time writing module is configured to:
determining a second time compensation value of the corresponding time zone relative to UTC time according to the corresponding time zone of the time with the time zone attribute, wherein the unit of the second time compensation value is second;
determining a second increment value of the target time compared with the initial 0 time, wherein the unit of the second increment value is second;
and converting the time without the time zone attribute into a time format based on the initial 0 time after adding the second time compensation value to the second increment value.
Corresponding to the above method embodiment, an embodiment of the present application further provides a time conversion device, including:
a memory for storing a computer program;
processor for implementing the steps of the time transfer method according to any one of claims 1 to 5 when executing a computer program.
As shown in fig. 6, which is a schematic diagram of a composition structure of the time conversion apparatus, the time conversion apparatus may include: a processor 10, a memory 11, a communication interface 12 and a communication bus 13. The processor 10, the memory 11 and the communication interface 12 all communicate with each other through a communication bus 13.
In the embodiment of the present application, the processor 10 may be a Central Processing Unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic device, etc.
The processor 10 may call a program stored in the memory 11, and in particular, the processor 10 may perform operations in an embodiment of the time conversion method.
The memory 11 is used for storing one or more programs, the program may include program codes, the program codes include computer operation instructions, in this embodiment, the memory 11 stores at least the program for implementing the following functions:
reading UTC time in an RTC register through an interrupt program;
converting the UTC time according to the current time zone to obtain the time with the time zone attribute;
the time with the time zone attribute is displayed in the configuration interface of the BIOS.
In one possible implementation, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as a conversion function, a display function), and the like; the stored data area may store data created during use, such as time data, time zone data, and the like.
Further, the memory 11 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device or other volatile solid state storage device.
The communication interface 13 may be an interface of a communication module for connecting with other devices or systems.
Of course, it should be noted that the structure shown in fig. 6 does not constitute a limitation of the time conversion device in the embodiment of the present application, and in practical applications, the time conversion device may include more or less components than those shown in fig. 6, or some components may be combined.
Corresponding to the above method embodiments, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the above time conversion method.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The principle and the implementation of the present application are explained in the present application by using specific examples, and the above description of the embodiments is only used to help understanding the technical solution and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.

Claims (10)

1. A time conversion method is applied to a Basic Input Output System (BIOS), and comprises the following steps:
reading UTC time in an RTC register through an interrupt program;
converting the UTC time according to the current time zone to obtain time with time zone attributes;
and displaying the time with the time zone attribute in a configuration interface of the BIOS.
2. The method of claim 1, wherein the converting the UTC time according to the time zone set by the user to obtain the time with the time zone attribute comprises:
determining a first time compensation value of the UTC time relative to the current time zone according to the current time zone, wherein the unit of the first time compensation value is second;
determining a first delta value of the UTC time compared to an initial 0 time, the first delta value having a unit of seconds;
and converting the time with the time zone attribute into a time format based on the initial 0 time after adding the first time compensation value to the first increment value.
3. The method of claim 1, wherein the current time zone is: and the user sets the time zone selected by the switch through the time zone under the BIOS.
4. The method of any of claims 1 to 3, further comprising, after said displaying the time with time zone attribute in a configuration interface of the BIOS:
receiving a modification instruction of the time with the time zone attribute from a user;
determining modified target time according to the modification instruction;
converting the target time according to the corresponding time zone of the time with the time zone attribute to obtain the time without the time zone attribute;
storing the time without the time zone attribute as the UTC time in the RTC register.
5. The method of claim 4, wherein converting the target time according to the corresponding time zone of the time with time zone attribute to obtain the time without time zone attribute comprises:
determining a second time compensation value of the corresponding time zone relative to the UTC time according to the corresponding time zone of the time with the time zone attribute, wherein the unit of the second time compensation value is second;
determining a second increment value of the target time compared to an initial 0 time, the second increment value having a unit of seconds;
converting to a time without a time zone attribute in a time format based on the initial 0 time after adding the second time offset value to the second delta value.
6. A time conversion device applied to a Basic Input Output System (BIOS), the device comprising:
the time reading module is used for reading the UTC time in the RTC register through the interrupt program;
the time conversion module is used for converting the UTC time according to the current time zone to obtain the time with the time zone attribute;
and the time display module is used for displaying the time with the time zone attribute in the configuration interface of the BIOS.
7. The apparatus of claim 6, wherein the time conversion module is configured to:
determining a first time compensation value of the UTC time relative to the current time zone according to the current time zone, wherein the unit of the first time compensation value is second;
determining a first delta value of the UTC time compared to an initial 0 time, the first delta value having a unit of seconds;
and converting the time with the time zone attribute into a time format based on the initial 0 time after adding the first time compensation value to the first increment value.
8. The apparatus of claim 6 or 7, further comprising a time writing module configured to:
after the time with the time zone attribute is displayed in the configuration interface of the BIOS, receiving a modification instruction of a user for the time with the time zone attribute;
determining modified target time according to the modification instruction;
converting the target time according to the corresponding time zone of the time with the time zone attribute to obtain the time without the time zone attribute;
storing the time without the time zone attribute as the UTC time in the RTC register.
9. A time conversion apparatus, characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the time transfer method as claimed in any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the time-conversion method according to any one of claims 1 to 5.
CN202010131176.6A 2020-02-28 2020-02-28 Time conversion method, device, equipment and storage medium Withdrawn CN111399916A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010131176.6A CN111399916A (en) 2020-02-28 2020-02-28 Time conversion method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010131176.6A CN111399916A (en) 2020-02-28 2020-02-28 Time conversion method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111399916A true CN111399916A (en) 2020-07-10

Family

ID=71432156

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010131176.6A Withdrawn CN111399916A (en) 2020-02-28 2020-02-28 Time conversion method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111399916A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113126694A (en) * 2021-04-13 2021-07-16 山东英信计算机技术有限公司 Time synchronization method, system, equipment and storage medium of computer management subsystem

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113126694A (en) * 2021-04-13 2021-07-16 山东英信计算机技术有限公司 Time synchronization method, system, equipment and storage medium of computer management subsystem
CN113126694B (en) * 2021-04-13 2023-08-04 山东英信计算机技术有限公司 Time setting method, system, equipment and storage medium of computer management subsystem

Similar Documents

Publication Publication Date Title
CN107332879B (en) Information pushing method, mobile terminal and storage medium
EP4345611A1 (en) Bootloader loading method, apparatus and system, electronic device and medium
CN111399916A (en) Time conversion method, device, equipment and storage medium
CN109782841B (en) Real-time clock implementation method based on RTC chip, terminal equipment and storage medium
CN114756150B (en) Application icon management method, terminal equipment and storage medium
CN102243578A (en) Method, system and device for decoding command of chip
CN112328289B (en) Firmware upgrading method, device, equipment and storage medium
US5469411A (en) Method and apparatus for accurate time maintenance and display
CN107121920A (en) A kind of clock display method and intelligent watch
CN115643160A (en) Data acquisition method, device, equipment and medium based on daisy chain communication
CN111464688B (en) Working mode switching method and device
JP3350005B2 (en) Counter reading control device and control method thereof
US6426920B2 (en) Method and apparatus for setting initial time of operating system clock
EP3043265A1 (en) Debug device, debug method, and debug program
JP2001331342A (en) Method for displaying information processor error and recording medium with error display program recorded thereon
US4468133A (en) Electronic timepiece
CN111726604A (en) Setting method and device of working mode data, terminal and readable storage medium
CN111352790A (en) Test method and device for reporting input event, mobile terminal and storage medium
JP3184998B2 (en) The process of checking the memory of a programmed microcomputer by a microprogram embedded in the microcomputer itself
CN110569072B (en) Computer startup screen display processing method
CN114547144B (en) Time sequence data range query method, device and equipment
CN114021041A (en) Display method and device of sharing control, electronic equipment and storage medium
CN109272350B (en) Cell type determination method and device and electronic equipment
JPS63200234A (en) Data processor
CN110134402B (en) Method for generating animation of RAM and register change in simulation operation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20200710

WW01 Invention patent application withdrawn after publication