CN110716781B - Time display method, configuration method and device for multiple time zones - Google Patents

Time display method, configuration method and device for multiple time zones Download PDF

Info

Publication number
CN110716781B
CN110716781B CN201910927893.7A CN201910927893A CN110716781B CN 110716781 B CN110716781 B CN 110716781B CN 201910927893 A CN201910927893 A CN 201910927893A CN 110716781 B CN110716781 B CN 110716781B
Authority
CN
China
Prior art keywords
time
time zone
background
offset
zone
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.)
Active
Application number
CN201910927893.7A
Other languages
Chinese (zh)
Other versions
CN110716781A (en
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.)
Beijing Lewo Wuxian Technology Co ltd
Original Assignee
Beijing Lewo Wuxian 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 Beijing Lewo Wuxian Technology Co ltd filed Critical Beijing Lewo Wuxian Technology Co ltd
Priority to CN201910927893.7A priority Critical patent/CN110716781B/en
Publication of CN110716781A publication Critical patent/CN110716781A/en
Application granted granted Critical
Publication of CN110716781B publication Critical patent/CN110716781B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Electric Clocks (AREA)

Abstract

The embodiment of the invention discloses a time display method, a time display configuration method and a time display device for multiple time zones, relates to the technical field of computers, and can greatly simplify time display operation and time display configuration operation for multiple time zones and effectively improve the efficiency and accuracy of time display and time display configuration for multiple time zones. The display method comprises the following steps: reading a third duration parameter corresponding to the time item to be displayed from a preset database; determining a background time zone based on the display operation of the time item, wherein the background time zone is one of 24 geographic time zones worldwide; according to the background offset of the background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone, the third time length parameter is adjusted to obtain a fourth time length parameter; and displaying the time item as the time which is reached after the duration corresponding to the fourth time length parameter passes by taking the preset reference time as the basis. The invention is suitable for application scenes of various time zone conversion.

Description

Time display method, configuration method and device for multiple time zones
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for displaying and configuring time in multiple time zones.
Background
In the internationalized multi-time zone APP application management background, it is generally necessary to deal with internationalized time zone problems such as date, time, etc. For example, an operator configures an activity item in the united states in the management background located in china, and the activity start/end time set by the date-time selection control is the system time acquired from the browser or the client (i.e., the china-time), however, it may be actually required to set the united states time.
Since the time zones of different countries/regions are different, the time allocation in the management background is usually based on the system time, and thus the time of the management background displayed in different countries/regions may be different (for example, the time of the united states is displayed in the united states and the time of the china is displayed in the china), when the time is allocated in multiple time zones (for example, multiple operators perform time allocation in different countries/regions or one operator allocates multiple time zones in a fixed country/region), the management background is very confusing, and if the management background is improperly handled, a series of time errors and compatibility problems may be caused.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, a device, and a system for displaying and configuring time in multiple time zones, which can greatly simplify the time display operation and the configuration operation in multiple time zones, and effectively improve the efficiency and accuracy of time display and configuration in multiple time zones.
In a first aspect, an embodiment of the present invention further provides a time display method for multiple time zones, including: reading a third duration parameter corresponding to the time item to be displayed from a preset database; determining a background time zone based on the display operation of the time item, wherein the background time zone is one of 24 geographic time zones worldwide; according to the background offset of the background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone, the third time length parameter is adjusted to obtain a fourth time length parameter; wherein, the middle time zone is the time zone in which the original meridian is located in the 24 geographical time zones; and displaying the time item as the time which is reached after the duration corresponding to the fourth time length parameter passes by taking the preset reference time as the basis.
Optionally, the adjusting the third time length parameter according to the background offset of the background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone, to obtain a fourth time length parameter includes: the fourth time length parameter is equal to the third time length parameter plus the difference between the background offset and the offset of the system offset.
Optionally, the displaying the time item is based on a preset reference time, and after the time reached after the duration corresponding to the fourth time parameter passes, the method further includes: and carrying out time zone switching display on the displayed time item.
Optionally, the displaying the time zone switching of the displayed time item includes: acquiring an original time length parameter corresponding to a time item of an original background time zone; determining an original background offset of the original background time zone relative to the middle time zone and a new background offset of the new background time zone relative to the middle time zone; determining that a new time length parameter after switching is equal to the difference between the original time length parameter and the offset of the new background offset and the original background offset; and displaying the time which is reached after the time corresponding to the new time parameter passes by taking the preset reference time as the basis in the new background time zone.
Optionally, the displaying the time zone switching of the displayed time item includes: acquiring an original time length parameter corresponding to a time item of an original background time zone; according to the original background offset of the original background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone, converting the original time length parameter into a system time length parameter corresponding to the current system time zone; according to the new background offset of the new background time zone relative to the middle time zone and the system offset, converting the system duration parameter into a new duration parameter corresponding to the new background time zone; and displaying the time which is reached after the time corresponding to the new time parameter passes by taking the preset reference time as the basis in the new background time zone.
In a second aspect, an embodiment of the present invention provides a time configuration method for multiple time zones, including: determining a background time zone aimed by configuration operation, wherein the background time zone is one of 24 geographic time zones worldwide; converting a target configuration time input by a user into a first time parameter, wherein the first time parameter is equal to the time difference between the target configuration time and a preset reference time; according to the background offset of the background time zone relative to the middle time zone, the first time length parameter is adjusted to obtain a second time length parameter corresponding to the target configuration time, and the second time length parameter is stored in a database; the middle time zone is the time zone in which the original meridian is located in the 24 geographical time zones.
Optionally, the adjusting the first duration parameter according to the background offset of the background time zone relative to the middle time zone, and obtaining a second duration parameter corresponding to the target configuration time includes: determining a background offset of the background time zone relative to the middle time zone according to the relative relation between the time zones; and determining the second time length parameter according to the first time length parameter and the background offset, wherein the second time length parameter is equal to the sum of the first time length parameter and the background offset.
In a third aspect, embodiments of the present invention also provide a time display apparatus for multiple time zones, including: the reading unit is used for reading a third duration parameter corresponding to the time item to be displayed from a preset database; a second determining unit, configured to determine a background time zone based on which the displaying operation of the time item is based, where the background time zone is one of 24 geographic time zones worldwide; the second adjusting unit is used for adjusting the third time length parameter according to the background offset of the background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone to obtain a fourth time length parameter; wherein, the middle time zone is the time zone in which the original meridian is located in the 24 geographical time zones; the display unit is used for displaying the time item as the time which is reached after the time corresponding to the fourth time parameter passes by the preset reference time.
Optionally, the second adjusting unit is specifically configured to adjust the third duration parameter to the fourth duration parameter, where the fourth duration parameter is equal to a difference between the third duration parameter and an offset of the background offset and the system offset.
Optionally, the time display device further includes a switching unit, configured to perform time zone switching display on the displayed time item after the time reached after the time corresponding to the fourth time parameter passes through the time based on a preset reference time.
Optionally, the switching unit includes: the first acquisition module is used for acquiring an original duration parameter corresponding to a time item of an original background time zone; the first determining module is used for determining an original background offset of the original background time zone relative to the middle time zone and a new background offset of the new background time zone relative to the middle time zone; the second determining module is used for determining that the new time length parameter after switching is equal to the difference between the original time length parameter and the offset of the new background offset and the original background offset; the first display module is used for displaying the time which is reached after the time corresponding to the new time parameter passes by based on the preset reference time in the new background time zone.
Optionally, the switching unit includes: the second acquisition module is used for acquiring the original duration parameters corresponding to the time items of the original background time zone; the first conversion module is used for converting the original time length parameter into a system time length parameter corresponding to the current system time zone according to the original background offset of the original background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone; the second conversion module is used for converting the system time length parameter into a new time length parameter corresponding to the new background time zone according to the new background offset of the new background time zone relative to the middle time zone and the system offset; and the second display module is used for displaying the time which is reached after the time corresponding to the new time parameter passes by based on the preset reference time in the new background time zone.
In a fourth aspect, an embodiment of the present invention further provides a time configuration apparatus for multiple time zones, including: a first determining unit, configured to determine a background time zone for which configuration operation is aimed, where the background time zone is one of 24 geographic time zones worldwide; the conversion unit is used for converting the target configuration time input by the user into a first time length parameter, wherein the first time length parameter is equal to the time difference between the target configuration time and a preset reference time; the first adjusting unit is used for adjusting the first time length parameter according to the background offset of the background time zone relative to the middle time zone to obtain a second time length parameter corresponding to the target configuration time, and storing the second time length parameter into a database; the middle time zone is the time zone in which the original meridian is located in the 24 geographical time zones.
Optionally, the first adjusting unit is specifically configured to: determining a background offset of the background time zone relative to the middle time zone according to the relative relation between the time zones; and determining the second time length parameter according to the first time length parameter and the background offset, wherein the second time length parameter is equal to the sum of the first time length parameter and the background offset.
In a fifth aspect, embodiments of the present invention further provide an electronic device, including: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space surrounded by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing any of the multi-time zone time configuration methods or any of the multi-time zone time presentation methods provided by the embodiments of the present invention.
In a sixth aspect, embodiments of the present invention also provide a computer-readable storage medium storing one or more programs executable by one or more processors to implement any of the multi-time zone time configuration methods or any of the multi-time zone time presentation methods provided by the embodiments of the present invention.
According to the time display method, the time display configuration method and the time display device for the multiple time zones, through establishing the management mechanism of the background time zone, a user can accurately display and configure the time of the time zone by selecting the corresponding background time zone without various complicated time zone conversion when displaying and configuring the time, so that the time display operation and the time configuration operation for the multiple time zones are greatly simplified, and the efficiency and the accuracy of the time display and the time configuration for the multiple time zones are effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for multi-time zone time display provided by an embodiment of the present invention;
FIG. 2 is a schematic diagram showing an effect before a background time zone is switched in an embodiment of the present invention;
FIG. 3 is a schematic diagram showing an effect after a background time zone is switched in an embodiment of the present invention;
FIG. 4 is a detailed flow chart of a method for multi-time zone time display provided by an embodiment of the present invention;
FIG. 5 is a flow chart of a method for time configuration for multiple time zones according to an embodiment of the present invention;
FIG. 6 is a schematic diagram showing an effect of background time zone selection in an embodiment of the invention;
FIG. 7 is a schematic diagram showing another effect of background time zone selection in an embodiment of the present invention;
FIG. 8 is a schematic diagram showing another effect of background time zone selection in an embodiment of the present invention;
FIG. 9 is a detailed flow chart of a method for time configuration for multiple time zones provided by an embodiment of the present invention;
FIG. 10 is a schematic diagram of a multi-time zone time display device according to an embodiment of the present invention;
FIG. 11 is a schematic diagram of a time configuration device with multiple time zones according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are merely some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In a first aspect, embodiments of the present invention further provide a method for displaying a time in multiple time zones, which can greatly simplify a time display operation in multiple time zones, and effectively improve efficiency and accuracy of time display in multiple time zones.
As shown in FIG. 1, an embodiment of the present invention provides a time display method for multiple time zones, which may include:
s11, reading a third duration parameter corresponding to a time item to be displayed from a preset database;
In the embodiment of the present invention, a third duration parameter (i.e., a time interval between a time to be displayed and a certain preset reference time) corresponding to a time item to be displayed may be recorded in a preset database. Alternatively, the preset database may be a database in which data configured by a multi-time zone time configuration method provided according to an embodiment of the present invention is stored, or may be a database provided by a third party, which is not limited in the embodiment of the present invention.
S12, determining a background time zone based on the display operation of the time item, wherein the background time zone is one of 24 geographic time zones worldwide;
it will be appreciated that when viewing information such as activity time, the user has its own time reference system, for example, when the user is in the united states, the user may refer to the time in the west 5 region, and if the user wants to view the activity time corresponding to several minutes of Beijing time, the user may refer to the time in the east 8 region. In order to determine the time reference frame of the user, in this step, a background time zone based on which the presentation operation of the time item is based may be determined according to the selection of the user, for example, the user may select a time zone such as east 1 zone, west 3 zone, or the like as the background time zone.
S13, adjusting the third time length parameter according to the background offset of the background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone to obtain a fourth time length parameter; wherein, the middle time zone is the time zone in which the original meridian is located in the 24 geographical time zones;
in this step, the system time zone of the current computer system may be obtained, and the system offset of the system time zone relative to the middle time zone may be calculated, and the third time length parameter may be adjusted to obtain a fourth time length parameter by using the system offset and the background offset of the background time zone relative to the middle time zone, so as to convert the third time length parameter read from the database into the fourth time length parameter with the background time zone as a reference.
And S14, displaying the time item as the time which is reached after the duration corresponding to the fourth time parameter passes by taking the preset reference time as the basis.
Because the fourth time parameter is a relative value, and the user wants to display a specific time, in order to facilitate the user to view the time, in this step, the time item to be displayed may be determined according to the inverse operation of the calculation method of the time length parameter. For example, in one embodiment of the present invention, the duration parameter is based on 1970, 1 month and 1 day (00:00:00 gmt (Greenwich Mean Time, greenwich mean time)), and the fourth duration parameter is added to the time base, so that the obtained time is a specific time corresponding to the time item to be displayed.
According to the time display method for the multiple time zones, the third time length parameter corresponding to the time item to be displayed can be read from the preset database, the background time zone based on the display operation of the time item is determined, the third time length parameter is adjusted according to the background offset of the background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone, the fourth time length parameter is obtained, and the time item is displayed as the time which arrives after the time length corresponding to the fourth time length parameter is passed on the basis of the preset reference time. Therefore, the background time zone corresponding to the display operation is set, the third time length parameter read from the database is adjusted according to the background offset and the system offset to obtain the fourth time length parameter, and the time length parameter stored in the database can be converted into the time zone aimed at by the display operation without complex time zone conversion, so that the time display operation of multiple time zones is greatly simplified, and the time display efficiency and accuracy of the multiple time zones are effectively improved.
Optionally, in step S13, adjusting the third duration parameter according to the background offset of the background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone, to obtain a fourth duration parameter may include:
Determining that the fourth time length parameter is equal to the third time length parameter plus the difference between the background offset and the offset of the system offset.
For example, in one embodiment of the present invention, the background time zone is the eastern 8 zone, the system time zone is the middle time zone, the third duration parameter read from the database is 1566446400, the background offset is 8-0=8 hours, the system offset is 0-0=0, and the fourth duration parameter= 1566446400+ (8-0) x 60 x 60= 1566475200.
Further, in one embodiment of the present invention, after the time item read in the database is displayed, different background time zones may be switched to further display the time item, so as to facilitate the user to query and compare multiple time zones. Specifically, in step S14, the time item is displayed as a time that arrives after the duration corresponding to the fourth time parameter passes through the preset reference time, and the time displaying method for multiple time zones provided by the embodiment of the present invention may further include: and carrying out time zone switching display on the displayed time item. The effect of background time zone switching is schematically shown in fig. 2 and 3.
Optionally, when the time zone switching display is performed, the time zone switching operation can be directly switched from the original background time zone to the new background time zone, or can be performed by using the system time zone as a transition, so that the original background time zone is firstly converted into the system time zone, and then the system time zone is converted into the new background time zone. The following is a description of two examples.
Specifically, in one embodiment of the present invention, the time zone switching display of the time item may include:
acquiring an original time length parameter corresponding to a time item of an original background time zone;
determining an original background offset of the original background time zone relative to the middle time zone and a new background offset of the new background time zone relative to the middle time zone;
determining that a new time length parameter after switching is equal to the difference between the original time length parameter and the offset of the new background offset and the original background offset;
and displaying the time which is reached after the time corresponding to the new time parameter passes by taking the preset reference time as the basis in the new background time zone.
For example, in one embodiment of the present invention, the original background time zone is the tokyo-location time zone (eastern 9 zone), the time corresponding to the original background timestamp is the tokyo time 9 point, and the new background time zone is the london-location time zone (middle time zone). The handover result is as follows:
new duration parameter = original duration parameter + (0-9) 60 x 60 = original duration parameter-32400
And displaying the time which is reached after the time corresponding to the new time parameter passes by based on the preset reference time.
Optionally, in an embodiment of the present invention, the displaying the time zone switching display of the time item may include:
Acquiring an original time length parameter corresponding to a time item of an original background time zone;
according to the original background offset of the original background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone, converting the original time length parameter into a system time length parameter corresponding to the current system time zone;
according to the new background offset of the new background time zone relative to the middle time zone and the system offset, converting the system duration parameter into a new duration parameter corresponding to the new background time zone;
and displaying the time which is reached after the time corresponding to the new time parameter passes by taking the preset reference time as the basis in the new background time zone.
For ease of understanding, the present embodiment will be described collectively with reference to specific moments of time items, rather than to a duration parameter.
In one embodiment of the present invention, the original background time zone is a tokyo-location time zone (eastern 9 zone), the time corresponding to the original background timestamp is a tokyo time 9 point, the system for performing the time item display operation is located in beijing, the system time is a beijing time zone (eastern 8 zone), and the new background time zone is a london-location time zone (middle time zone). The handover procedure is as follows:
Firstly, switching an original background time zone of a time stamp into a system time zone (an east 9 zone is switched into an east 8 zone), and converting the corresponding time into 9 points- (9-8) hours = 8 points;
the time stamp after switching to the system time zone is converted to london time (east 8 zone switched to central zone): 8 points- (8-0) hours = 0 points.
That is, if the original start time of the activity is 9 points in tokyo time, after the background time zone is switched, the start time of the activity displayed in the new background time zone is 0 points in london time.
The time display method for multiple time zones provided by the embodiment of the invention is described in detail below through specific embodiments.
As shown in fig. 4, the time presentation method for multiple time zones according to the embodiment of the present invention may include:
s701, determining a new background time zone switched to;
s702, reading a third duration parameter in a database;
s703, converting the third time length parameter into a system time length parameter of the current computer system;
s704, respectively determining a new background offset of the new background time zone relative to the middle time zone and a system offset of the system time zone of the current computer system relative to the middle time zone;
s705, correcting the system time length parameter by utilizing the difference value between the new background offset and the system offset to form a fourth time length parameter;
S706, generating a corresponding time character string by the fourth time length parameter;
s707, updating all time display of the configuration interface by using the generated time character string.
In a second aspect, an embodiment of the present invention provides a time configuration method for multiple time zones, which can simplify time configuration operations for multiple time zones, and effectively improve efficiency and accuracy of time configuration for multiple time zones.
As shown in fig. 5, the time configuration method for multiple time zones according to the embodiment of the present invention includes:
s21, determining a background time zone aimed by configuration operation, wherein the background time zone is one of 24 geographic time zones worldwide;
in this step, the background time zone for which the current operation is performed may be determined according to the selection of the user, or the background time zone for which the operation is performed may be determined according to a pre-configured parameter or file. For example, if the user needs to configure an activity in new york and input each time node in the activity, the background time zone may be selected as the geographical time zone in new york (the western five zone), or the time zone in new york may be written in the configuration file in advance, and the background time zone is determined to be the western five zone by reading the configuration file. An interface schematic for determining the background time zone may be shown in fig. 6, 7 and 8.
In the embodiment of the invention, after the background time zone is determined, all background operations are based on the background time zone, and are irrelevant to other system time zones, server time zones, local time zones and the like.
Alternatively, the background time zone may be any one of 24 geographical time zones worldwide, and the user may specifically select according to the needs of the configuration operation.
S22, converting the target configuration time input by a user into a first time parameter, wherein the first time parameter is equal to the time difference between the target configuration time and a preset reference time;
the target configuration time may be each time node that the user needs to configure, for example, a start time, a rest time, an end time, and the like of the activity. In one embodiment of the invention, a user may be provided with a time input option or time selection control via a front-end device such as a browser or client to receive a target configuration time of user input, e.g., target configuration time 2019, 9, 18, 14, which may be received by the client to receive user input: 30:00.
specifically, the target configuration time is convenient for the user to view, but is inconvenient to calculate, so in the embodiment of the invention, the target configuration time can be converted into a first time parameter, namely, a time difference between the target configuration time and a preset reference time, wherein the time difference is a time period from the preset reference time to the target configuration time.
Alternatively, the preset reference time may be any past historical time, which is not limited by the embodiment of the present invention. In view of the versatility and convenience of the multi-time zone time setting, in one embodiment of the present invention, this preset reference time instant may be determined as a reference time instant in the definition of "time stamp" in the international standard, i.e. 1 month 1 day 1970 (00:00:00:00 gmt (Greenwich Mean Time, greenwich mean time)). Based on the reference time, the target configuration time input by the user may be converted into how many seconds elapse from the reference time, for example, the first time length parameter (i.e., standard timestamp) corresponding to Beijing time 2019-08-25 18:02:15 is 1566727335.
S23, adjusting the first time length parameter according to the background offset of the background time zone relative to the middle time zone to obtain a second time length parameter corresponding to the target configuration time, and storing the second time length parameter into a database; the middle time zone is the time zone in which the original meridian is located in the 24 geographical time zones.
It should be noted that, the first time length parameter itself does not have a time zone attribute, and in this step, the first time length parameter may be adjusted according to the offset of the background time zone relative to the middle time zone to obtain a second time length parameter, where the second time length parameter has a time zone attribute. In one embodiment of the present invention, the second duration parameter may be stored in a database as a time basis for subsequent queries and invocations.
In the embodiment of the present invention, the offset of the background time zone with respect to the middle time zone is positive, wherein the offset of the east 1 zone to the east 12 zone with respect to the middle time zone is positive, and the offset of the west 1 zone to the west 11 zone with respect to the middle time zone is negative.
According to the time configuration method for the multiple time zones, which is provided by the embodiment of the invention, the time zone aimed by the configuration operation can be determined as the background time zone, the target configuration time input by the user is converted into the first time length parameter, the first time length parameter is adjusted according to the background offset of the background time zone relative to the middle time zone, the second time length parameter corresponding to the target configuration time is obtained, and the second time length parameter is directly stored in the database. Therefore, by establishing the management mechanism of the background time zone, a user can realize accurate configuration of the time zone by selecting the corresponding background time zone without various complicated time zone conversions when the time is configured, thereby greatly simplifying the time configuration operation of multiple time zones and effectively improving the time configuration efficiency and accuracy of the multiple time zones.
Optionally, in step S23, adjusting the first duration parameter according to the background offset of the background time zone relative to the middle time zone, and obtaining the second duration parameter corresponding to the target configuration time may specifically include:
Determining a background offset of the background time zone relative to the middle time zone according to the relative relation between the time zones;
and determining the second time length parameter according to the first time length parameter and the background offset, wherein the second time length parameter is equal to the sum of the first time length parameter and the background offset.
For example, in one embodiment of the present invention, the start time of an activity that the user needs to configure tokyo is 2019-08-22 12:00:00, and the corresponding first time length parameter is 1566417600. And determining that the background offset of the east 9 zone relative to the middle time zone is 9-0=9 (hours) according to the relative relation of time zones (for example, according to a calculation formula or inquiring an international time zone conversion table), and converting the background offset into the background offset of 9×60×60=34200 in units of seconds. The second duration parameter is 1566417600+34200= 1566451800. Alternatively, in another embodiment of the present invention, if the selected background time zone is the western 9 zone, the second duration parameter is 1566417600-34200 = 1566383400.
By the scheme, no matter where the user is, the complex time zone calculation and conversion are not needed, and only the background time zone aimed by the configuration operation is selected, so that the time configuration operation of multiple time zones is greatly simplified, and the time configuration efficiency and accuracy of the multiple time zones are effectively improved.
The time configuration method for multiple time zones provided by the embodiment of the present invention will be described in detail by means of specific embodiments.
As shown in fig. 9, the time configuration method for multiple time zones provided by the embodiment of the present invention may include:
s601, acquiring a multi-time zone configuration requirement;
s602, setting a background time zone according to configuration requirements, and determining background offset of the background time zone relative to the middle time zone;
s603, receiving target configuration time such as date and time input by a user under the background time zone;
s604, generating a target time character string from the received target configuration time;
s605, converting the time string into a first time length parameter (such as a standard timestamp);
s606, converting the first time length parameter into a second time length parameter according to the background offset;
s607, storing the second time length parameter into a database.
In a third aspect, embodiments of the present invention further provide a multi-time zone time display apparatus, which can greatly simplify a multi-time zone time display operation, and effectively improve multi-time zone time display efficiency and accuracy.
As shown in fig. 10, a multi-time zone time display apparatus according to an embodiment of the present invention may include:
the reading unit 31 is configured to read a third duration parameter corresponding to a time item to be displayed from a preset database;
A second determining unit 32 configured to determine a background time zone based on which the presentation operation of the time item is based, wherein the background time zone is one of 24 geographic time zones worldwide;
a second adjusting unit 33, configured to adjust the third duration parameter according to a background offset of the background time zone relative to the middle time zone and a system offset of a current system time zone relative to the middle time zone, so as to obtain a fourth duration parameter; wherein, the middle time zone is the time zone in which the original meridian is located in the 24 geographical time zones;
and the display unit 34 is configured to display the time item as a time reached after the duration corresponding to the fourth time parameter passes, based on a preset reference time.
According to the time display device with multiple time zones, the third time length parameter corresponding to the time item to be displayed can be read from the preset database, the background time zone based on the display operation of the time item is determined, the third time length parameter is adjusted according to the background offset of the background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone, the fourth time length parameter is obtained, and the time item is displayed as the time which arrives after the time length corresponding to the fourth time length parameter is passed on the basis of the preset reference time. Therefore, the background time zone corresponding to the display operation is set, the third time length parameter read from the database is adjusted according to the background offset and the system offset to obtain the fourth time length parameter, and the time length parameter stored in the database can be converted into the time zone aimed at by the display operation without complex time zone conversion, so that the time display operation of multiple time zones is greatly simplified, and the time display efficiency and accuracy of the multiple time zones are effectively improved.
Optionally, the second adjusting unit 33 is specifically configured to adjust the third duration parameter to the fourth duration parameter, where the fourth duration parameter is equal to a difference between the third duration parameter and an offset of the background offset and the system offset.
Optionally, the time display device for multiple time zones provided by the embodiment of the present invention may further include a switching unit, configured to display the time item displayed as a time zone switching display after the time reached after the time corresponding to the fourth time parameter passes through the time corresponding to the fourth time parameter based on a preset reference time.
Alternatively, the switching unit may include:
the first acquisition module is used for acquiring an original duration parameter corresponding to a time item of an original background time zone;
the first determining module is used for determining an original background offset of the original background time zone relative to the middle time zone and a new background offset of the new background time zone relative to the middle time zone;
the second determining module is used for determining that the new time length parameter after switching is equal to the difference between the original time length parameter and the offset of the new background offset and the original background offset;
the first display module is used for displaying the time which is reached after the time corresponding to the new time parameter passes by based on the preset reference time in the new background time zone.
Alternatively, the switching unit may include:
the second acquisition module is used for acquiring the original duration parameters corresponding to the time items of the original background time zone;
the first conversion module is used for converting the original time length parameter into a system time length parameter corresponding to the current system time zone according to the original background offset of the original background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone;
the second conversion module is used for converting the system time length parameter into a new time length parameter corresponding to the new background time zone according to the new background offset of the new background time zone relative to the middle time zone and the system offset;
and the second display module is used for displaying the time which is reached after the time corresponding to the new time parameter passes by based on the preset reference time in the new background time zone.
In a fourth aspect, embodiments of the present invention further provide a multi-time zone time configuration apparatus, which can simplify a multi-time zone time configuration operation, and effectively improve efficiency and accuracy of multi-time zone time configuration.
As shown in fig. 11, a time configuration apparatus for multiple time zones according to an embodiment of the present invention may include:
A first determining unit 41 for determining a background time zone for which the configuration operation is directed, the background time zone being one of 24 geographical time zones worldwide;
a conversion unit 42, configured to convert a target configuration time input by a user into a first time parameter, where the first time parameter is equal to a time difference between the target configuration time and a preset reference time;
a first adjusting unit 43, configured to adjust the first duration parameter according to a background offset of the background time zone relative to the middle time zone, obtain a second duration parameter corresponding to the target configuration time, and store the second duration parameter in a database; the middle time zone is the time zone in which the original meridian is located in the 24 geographical time zones.
The time zone configuration device for multiple time zones provided by the embodiment of the invention can determine the time zone aimed by configuration operation as a background time zone, convert target configuration time input by a user into the first time length parameter, adjust the first time length parameter according to the background offset of the background time zone relative to the middle time zone, obtain the second time length parameter corresponding to the target configuration time, and directly store the second time length parameter into the database. Therefore, by establishing the management mechanism of the background time zone, a user can realize accurate configuration of the time zone by selecting the corresponding background time zone without various complicated time zone conversions when the time is configured, thereby greatly simplifying the time configuration operation of multiple time zones and effectively improving the time configuration efficiency and accuracy of the multiple time zones.
Optionally, the first adjusting unit 43 may be specifically configured to:
determining a background offset of the background time zone relative to the middle time zone according to the relative relation between the time zones;
and determining the second time length parameter according to the first time length parameter and the background offset, wherein the second time length parameter is equal to the sum of the first time length parameter and the background offset.
In a fifth aspect, an embodiment of the present invention further provides an electronic device, which can greatly simplify time configuration and/or display operations in multiple time zones, and effectively improve efficiency and accuracy of time configuration and/or display in multiple time zones.
As shown in fig. 12, an electronic device provided by an embodiment of the present invention may include: the processor 52 and the memory 53 are arranged on the circuit board 54, wherein the circuit board 54 is arranged in a space surrounded by the shell 51; a power supply circuit 55 for supplying power to the respective circuits or devices of the above-described electronic apparatus; the memory 53 is for storing executable program code; the processor 52 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 53 for executing the time configuration method of multiple time zones or the time presentation method of multiple time zones provided in any of the foregoing embodiments.
The specific implementation of the above steps by the processor 52 and the further implementation of the steps by the processor 52 through the execution of the executable program code may be referred to the description of the foregoing embodiments, and will not be repeated here.
Such electronic devices exist in a variety of forms including, but not limited to:
(1) A mobile communication device: such devices are characterized by mobile communication capabilities and are primarily aimed at providing voice, data communications. Such terminals include: smart phones (e.g., iPhone), multimedia phones, functional phones, and low-end phones, etc.
(2) Ultra mobile personal computer device: such devices are in the category of personal computers, having computing and processing functions, and generally also having mobile internet access characteristics. Such terminals include: PDA, MID, and UMPC devices, etc., such as iPad.
(3) Portable entertainment device: such devices may display and play multimedia content. The device comprises: audio, video players (e.g., iPod), palm game consoles, electronic books, and smart toys and portable car navigation devices.
(4) And (3) a server: the configuration of the server includes a processor, a hard disk, a memory, a system bus, and the like, and the server is similar to a general computer architecture, but is required to provide highly reliable services, and thus has high requirements in terms of processing capacity, stability, reliability, security, scalability, manageability, and the like.
(5) Other electronic devices with data interaction functions.
In a sixth aspect, an embodiment of the present invention further provides a computer readable storage medium, where one or more programs are stored, where the one or more programs may be executed by one or more processors, so as to implement any of the multi-time zone time configuration method or the multi-time zone time display method provided in the foregoing embodiment, and thus, corresponding technical effects may also be achieved, which have been described in detail above and will not be repeated herein.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
For convenience of description, the above apparatus is described as being functionally divided into various units/modules, respectively. Of course, the functions of the various elements/modules may be implemented in the same piece or pieces of software and/or hardware when implementing the present invention.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the scope of the present invention should be included in the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

1. The time display method of the multi-time zone is characterized by being applied to an internationalized multi-time zone APP application management background and comprising the following steps of:
reading a third duration parameter corresponding to the time item to be displayed from a preset database;
determining a background time zone based on the display operation of the time item, wherein the background time zone is one of 24 geographic time zones worldwide; all background operations are based on the background time zone, independent of the system time zone, the server time zone, the local time zone;
according to the background offset of the background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone, the third time length parameter is adjusted to obtain a fourth time length parameter; wherein, the middle time zone is the time zone in which the original meridian is located in the 24 geographical time zones;
Displaying the time item as a time which is reached after the duration corresponding to the fourth time length parameter passes by taking the preset reference time as a basis;
and carrying out time zone switching display on the displayed time item, wherein the time zone switching comprises switching from an original background time zone to a new background time zone.
2. The method of claim 1, wherein the adjusting the third time length parameter according to the background offset of the background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone to obtain a fourth time length parameter comprises:
the fourth time length parameter is equal to the third time length parameter plus the difference between the background offset and the offset of the system offset.
3. The method of claim 1, wherein said time zone switching display of said time item on presentation comprises:
acquiring an original time length parameter corresponding to a time item of an original background time zone;
determining an original background offset of the original background time zone relative to the middle time zone and a new background offset of the new background time zone relative to the middle time zone;
determining that a new time length parameter after switching is equal to the difference between the original time length parameter and the offset of the new background offset and the original background offset;
And displaying the time which is reached after the time corresponding to the new time parameter passes by taking the preset reference time as the basis in the new background time zone.
4. The method of claim 1, wherein said time zone switching display of said time item on presentation comprises:
acquiring an original time length parameter corresponding to a time item of an original background time zone;
according to the original background offset of the original background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone, converting the original time length parameter into a system time length parameter corresponding to the current system time zone;
according to the new background offset of the new background time zone relative to the middle time zone and the system offset, converting the system duration parameter into a new duration parameter corresponding to the new background time zone;
and displaying the time which is reached after the time corresponding to the new time parameter passes by taking the preset reference time as the basis in the new background time zone.
5. A multi-time zone time display device, characterized by being applied to an internationalized multi-time zone APP application management background, comprising:
the reading unit is used for reading a third duration parameter corresponding to the time item to be displayed from a preset database;
A second determining unit, configured to determine a background time zone based on which the displaying operation of the time item is based, where the background time zone is one of 24 geographic time zones worldwide; all background operations are based on the background time zone, independent of the system time zone, the server time zone, the local time zone;
the second adjusting unit is used for adjusting the third time length parameter according to the background offset of the background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone to obtain a fourth time length parameter; wherein, the middle time zone is the time zone in which the original meridian is located in the 24 geographical time zones;
the display unit is used for displaying the time item as a time which is reached after the time corresponding to the fourth time parameter passes by the preset reference time;
and the switching unit is used for carrying out time zone switching display on the displayed time item, and the time zone switching comprises switching from an original background time zone to a new background time zone.
6. The apparatus according to claim 5, wherein the second adjusting unit is specifically configured to adjust the third duration parameter to the fourth duration parameter, and the fourth duration parameter is equal to a difference between the third duration parameter and an offset of the background offset and the system offset.
7. The apparatus of claim 5, wherein the switching unit comprises:
the first acquisition module is used for acquiring an original duration parameter corresponding to a time item of an original background time zone;
the first determining module is used for determining an original background offset of the original background time zone relative to the middle time zone and a new background offset of the new background time zone relative to the middle time zone;
the second determining module is used for determining that the new time length parameter after switching is equal to the difference between the original time length parameter and the offset of the new background offset and the original background offset;
the first display module is used for displaying the time which is reached after the time corresponding to the new time parameter passes by based on the preset reference time in the new background time zone.
8. The apparatus of claim 5, wherein the switching unit comprises:
the second acquisition module is used for acquiring the original duration parameters corresponding to the time items of the original background time zone;
the first conversion module is used for converting the original time length parameter into a system time length parameter corresponding to the current system time zone according to the original background offset of the original background time zone relative to the middle time zone and the system offset of the current system time zone relative to the middle time zone;
The second conversion module is used for converting the system time length parameter into a new time length parameter corresponding to the new background time zone according to the new background offset of the new background time zone relative to the middle time zone and the system offset;
and the second display module is used for displaying the time which is reached after the time corresponding to the new time parameter passes by based on the preset reference time in the new background time zone.
9. An electronic device, the electronic device comprising: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space surrounded by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; a processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the multi-time zone time presentation method of any one of the preceding claims 1-4.
10. A computer readable storage medium storing one or more programs executable by one or more processors to implement the multi-time zone time display method of any of the preceding claims 1-4.
CN201910927893.7A 2019-09-27 2019-09-27 Time display method, configuration method and device for multiple time zones Active CN110716781B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910927893.7A CN110716781B (en) 2019-09-27 2019-09-27 Time display method, configuration method and device for multiple time zones

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910927893.7A CN110716781B (en) 2019-09-27 2019-09-27 Time display method, configuration method and device for multiple time zones

Publications (2)

Publication Number Publication Date
CN110716781A CN110716781A (en) 2020-01-21
CN110716781B true CN110716781B (en) 2023-06-02

Family

ID=69211121

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910927893.7A Active CN110716781B (en) 2019-09-27 2019-09-27 Time display method, configuration method and device for multiple time zones

Country Status (1)

Country Link
CN (1) CN110716781B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111683215B (en) * 2020-06-05 2023-03-24 杭州海康威视数字技术股份有限公司 Video playback method and device, electronic equipment and computer readable storage medium
CN112686697A (en) * 2020-12-29 2021-04-20 百果园技术(新加坡)有限公司 Multi-dimension-based user behavior data processing method and device
CN114971676A (en) * 2022-04-08 2022-08-30 百果园技术(新加坡)有限公司 Activity event management system, method and equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5841972A (en) * 1997-01-03 1998-11-24 Ncr Corporation System using displayed configuration utility on monitor including list of target nodes, for administering interconnected nodes of computer network
CN1877620A (en) * 2005-04-25 2006-12-13 国际商业机器公司 Method and system for visualizing multiple time zones in a calendaring and scheduling application
JP2009043159A (en) * 2007-08-10 2009-02-26 Toshiba Solutions Corp Trading time display program and device
CN101997714A (en) * 2009-08-27 2011-03-30 华为技术有限公司 Time processing method, device and system
CN103092959A (en) * 2013-01-18 2013-05-08 中兴通讯股份有限公司 Processing method and device for task time zone
JP2013168711A (en) * 2012-02-14 2013-08-29 Nec Casio Mobile Communications Ltd Electronic equipment, information display system, information display method, and program
CN105892806A (en) * 2016-03-29 2016-08-24 乐视控股(北京)有限公司 Display method and device for multinational time-zone clocks and intelligent terminal

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020122355A1 (en) * 2001-01-10 2002-09-05 Williams Joseph F. Universal time zone conversion
CN1983315A (en) * 2006-04-30 2007-06-20 华为技术有限公司 System and method for synchronizing schedule reminding time zone
CN101387864A (en) * 2008-09-28 2009-03-18 深圳华为通信技术有限公司 Time display method and apparatus
CN103188396B (en) * 2011-12-29 2014-10-29 三星电子(中国)研发中心 Device and method for setting time information of affairs to be done in mobile terminals
US20150199077A1 (en) * 2013-05-23 2015-07-16 Google Inc. Scheduling and viewing a calender event using time zones based on a user's location at event time
EP3567834B1 (en) * 2017-01-25 2021-04-28 Huawei Technologies Co., Ltd. Schedule processing method and electronic terminal
CN108156233A (en) * 2017-12-20 2018-06-12 惠州Tcl家电集团有限公司 Data processing method, device and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5841972A (en) * 1997-01-03 1998-11-24 Ncr Corporation System using displayed configuration utility on monitor including list of target nodes, for administering interconnected nodes of computer network
CN1877620A (en) * 2005-04-25 2006-12-13 国际商业机器公司 Method and system for visualizing multiple time zones in a calendaring and scheduling application
JP2009043159A (en) * 2007-08-10 2009-02-26 Toshiba Solutions Corp Trading time display program and device
CN101997714A (en) * 2009-08-27 2011-03-30 华为技术有限公司 Time processing method, device and system
JP2013168711A (en) * 2012-02-14 2013-08-29 Nec Casio Mobile Communications Ltd Electronic equipment, information display system, information display method, and program
CN103092959A (en) * 2013-01-18 2013-05-08 中兴通讯股份有限公司 Processing method and device for task time zone
CN105892806A (en) * 2016-03-29 2016-08-24 乐视控股(北京)有限公司 Display method and device for multinational time-zone clocks and intelligent terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
J2EE系统中日期时间的处理方法;舒翔;;电脑与电信(11);全文 *

Also Published As

Publication number Publication date
CN110716781A (en) 2020-01-21

Similar Documents

Publication Publication Date Title
CN110716781B (en) Time display method, configuration method and device for multiple time zones
US9705944B2 (en) Multi-terminal synchronous play control method and apparatus
CN113365106B (en) Multimedia resource generation method and device, electronic equipment and storage medium
CN110716783A (en) Front-end page generation and deployment method and device, storage medium and equipment
CN112463634B (en) Software testing method and device under micro-service architecture
CN110990228A (en) Data interface monitoring method and device
CN104731585A (en) Display method and device of vote page
JP2018527611A (en) Method and device for recognizing time information from audio information
CN109379678A (en) Non-linear compensation method, device, storage medium and terminal device
CN104765793A (en) Software recommending method and server
CN111460279A (en) Information recommendation method and device, storage medium and computer equipment
CN105338154A (en) Method, device and terminal for contact person ordering
CN110875871A (en) Management method of instant messaging application and electronic equipment
CN107392653A (en) Electronic business card pushing method and device and user terminal
CN110008211A (en) Data query method, apparatus, electronic equipment and storage medium
CN104808982A (en) Application function simulation development method and device
CN108769232A (en) Application resource method for pushing, device, equipment and storage medium
RU2608670C2 (en) Method, device and terminal for prompt of sns system application
CN108874495B (en) Theme resource conversion method and device and electronic equipment
CN110598186A (en) Auxiliary processing method, device and system for image recognition
CN113961587A (en) Data display method, device and storage medium
CN104918236B (en) Environment decision-making system and method based on Wi-Fi
CN116974795A (en) Service path generation and service data verification method and device and electronic equipment
CN113553530A (en) Information reporting dynamic page configuration method and device
KR20120004953A (en) Method for monitoring user sensory performance of web service and recording medium therefore and computing device

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
GR01 Patent grant
GR01 Patent grant