This document provides a brief description of the TimeZone OpEN APIs. It provides the following services:
- Convert hh:mm string to int values.
- Convert minute offset into hour and minutes
- Convert week name to number value
- Set the time zone acronym parameter
- Get the time zone acronym parameter
- Get non-recurring summertime parameters
- Get non-recurring summertime parameters
- Set recurring summertime parameters
- Set non-recurring summertime parameters
- Get the summer-time mode
- Set the summer-time mode
- Gets the timezone acronym string
- Get the current synchronized UTC time since the Unix Epoch.
- Get the current UTC time since the Unix Epoch.
- know whether the summer-time is in effect or not.
- Adjusts current time for timezone and summer time
- Converts the given Raw time to UTC and then adds the timezone and summer time offsets if configured.
Example C Application timezone_example
Initialization
In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits.
timezone_example
timezone_example.c is a sample application that demonstrates the use of OpEN's TimeZone APIs. _example is started from the command line and can be used to exercise the various APIs by specifying arguments on the command line.
Sample Output
- Usage: ./_example <test#> <arg1> <arg2> ...
- Test 1: Convert hh:mm string to int values: ./timezone_example 1 <bufd>
- Test 2: Convert minute offset into hour and minutes: ./timezone_example 2 <minutes>
- Test 3: Convert month name to number value: ./timezone_example 3 <name>
- Test 4: Set the time zone acronym parameter: ./timezone_example 4 <acronym>
- Test 5: Get the time zone acronym parameter: ./timezone_example 5
- Test 6: Get non-recurring summertime parameters: ./timezone_example 6 <parameter>
- Test 7: Get recurring summertime parameters: ./timezone_example 7 <parameter>
- Test 8: Set recurring summertime parameters: ./timezone_example 8 <parameter><bufd>
- Test 9: Set non-recurring summertime parameters: ./timezone_example 9 <parameter><bufd>
- Test 10: Get the summer-time mode: _example 10
- Test 11: Set the summer-time mode: _example 11 <mode>
- Test 12: Gets the timezone acronym string: _example 13 <zoneName>
- Test 13: Get the current synchronized UTC time since the Unix Epoch: _example 14 <>
- Test 14: Get the current UTC time since the Unix Epoch: _example 15 <>
- Test 15: know whether the summer-time is in effect or not: _example 16 <>
- Test 16: Adjusts current time for timezone and summer time: _example 16 <year><month><day><hour><minutes><seconds>
- Test 17: Converts the given Raw time to UTC and then adds the timezone and summer time offsets if configured: _example 17 <rawTime>
- Test 18: Run API sanity checks: _example 18
CLI/API Cross Reference