Time :: assign - Set current time
The function provides different ways for setting a time value.
The time value is passed in the ODABA Interface::Time format and provides time in 1/100th seconds.
Implementation overview
- Set time value to number of centiseconds
Time :: assign ( iCentiseconds ) - Create an empty time value
Time :: assign (  ) - Set time value from hours, minutes, seconds and centiseconds
Time :: assign ( iHour, iMinute, iSecond, iCentisecond ) - Set ODABA time from unix timestamp
Time :: assign ( iUnixTime, bLocalTime ) - Set time from string value
Time :: assign ( sTime ) - Copy time value
Time :: assign ( cTime ) - Set unix time from time value
Time :: assign ( iUnixTime )
Implementation details
-
Set time value to number of centiseconds
odaba::Time & Time  :: assign ( int32 iCentiseconds )
The value passed in iCentiSeconds is considered as time value expressed in number of centiseconds and stored as time value. It is up to the application to interpret the time value as local or standard time value.
- iCentiseconds
- Centiseconds
Time span in hundredths of a second or centiseconds in a time value.
to list
- iCentiseconds
- Centiseconds
-
Create an empty time value
odaba::Time & Time  :: assign (  )
The function initializes time to empty.
to list
-
Set time value from hours, minutes, seconds and centiseconds
odaba::Time & Time  :: assign ( int32 iHour, int32 iMinute, int32 iSecond, int32 iCentisecond )
Any value might be passed for hour, minutes, seconds and centiseconds. There is no check, whether iHours:iMinutes:iSeconds,iCentiseconds is a valid time value. Instead, each parameter is converted into centiseconds and summed up to the total number of centiseconds stored as time value.
- iHour
- Hour
Hour of the day.
- iMinute
- Minute
Minute of the hour.
- iSecond
- Second
Second of the minute.
- iCentisecond
- Centisecond
Part (in hundredths) of the second.
to list
- iHour
- Hour
-
Set ODABA time from unix timestamp
odaba::Time & Time  :: assign ( int64 iUnixTime, bool bLocalTime )
The Unix timestamp, which is passed in iUnixTime , contains the number of seconds since 1.1.1970 0:00:00 (UTC). The Unix time stamp is converted into an ODABA time value ignoring the days stored in the time stamp. It is up to the application interpreting the value as local or standard time.
- iUnixTime
- Unix time stamp
The unix timestamp contains the number of seconds since 1.1.1970 0:00:00 (UTC), which is an absolute timestamp that might be converted into local time.
- bLocalTime
- Local or standard time
The option indicates, that a time value or timestamp contains local time ( true ) or Greenwich standard time ( false ).
to list
- iUnixTime
- Unix time stamp
-
Set time from string value
odaba::Time & Time  :: assign ( odaba::String &sTime )
The time value is set to the time value passed in string format.
- sTime
- Time value in string format
Time values are passed as string value with the following format:
hh[:mm[:ss[,cc]
Time values must not contain spaces.
to list
- sTime
- Time value in string format
-
Copy time value
odaba::Time & Time  :: assign ( odaba::Time &cTime )
The function copies the time value passed in cTime .
- cTime
- Time value
The time value is passed in the ODABA Interface::Time format and provides time in 1/100th seconds.
to list
- cTime
- Time value
-
Set unix time from time value
odaba::Time & Time  :: assign ( int64 iUnixTime )
The function returns a Unix timestamp from the time value. As date 'today' is assumed.
When true has been passed in bLocalTime , the time value is considered as local time and will be converted to Greenwich mean time (UTC) before storing the ODABA time value.
- iUnixTime
- Unix time stamp
The unix timestamp contains the number of seconds since 1.1.1970 0:00:00 (UTC), which is an absolute timestamp that might be converted into local time.
to list
- iUnixTime
- Unix time stamp