DateTime :: assign - Set timestamp value
The function provides different ways for setting a timestamp value.
A time stamp combines date and time
Implementation overview
- Create an empty timestamp
DateTime :: assign (  ) - Set timestamp from ODABA date and time
DateTime :: assign ( cDate, cTime ) - Copy passed timestamp
DateTime :: assign ( cDateTime ) - Get local time from unix timestamp
DateTime :: assign ( iUnixTime, bLocalTime ) - Create timestamp value from string
DateTime :: assign ( sDateTime ) - Set ODABA timestamp from unix timestamp
DateTime :: assign ( iUnixTime )
Implementation details
-
Create an empty timestamp
odaba::DateTime & DateTime  :: assign (  )
The function initializes the timestamp with an empty value.
to list
-
Set timestamp from ODABA date and time
odaba::DateTime & DateTime  :: assign ( odaba::Date &cDate, odaba::Time &cTime )
The function sets the timestamp value to the date passed in cDate and to the time passed in cTime.
- cDate
- Date
The date contains day, month and year, but not the time.
- cTime
- Time value
The time value is passed in the ODABA Interface::Time format and provides time in 1/100th seconds.
to list
- cDate
- Date
-
Copy passed timestamp
odaba::DateTime & DateTime  :: assign ( odaba::DateTime &cDateTime )
The function sets the timestamp passed in cDateTime as value for the timestamp.
- cDateTime
- Time stamp
A time stamp combines date and time
to list
- cDateTime
- Time stamp
-
Get local time from unix timestamp
odaba::DateTime & DateTime  :: 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). When bLocalTime is true, the Unix timestamp is supposed to contain a standard time value (UTC), which will be adjusted to local time. When bLocalTime is false, the time value is not converted.
- 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
-
Create timestamp value from string
odaba::DateTime & DateTime  :: assign ( odaba::String &sDateTime )
The function converts the string into a timestamp value. When no time is passed in the string, time is assumed to be 00:00:00,00.
- sDateTime
- DateTime value in string format
Date time values in string format are passed as follows:
date time
Date and time are separated by exactly one blank character. Date has to be passed in one of following date string formats.
Standard: yyyy-mm-dd or yyyymmdd
English: mm/dd/yyyy
German: dd.mm.yyyy
Time has to be passed as:
hh[:mm[:ss[,cc]]]
Time values must not contain spaces.
2009-11-19 11:23:17,43
to list
- sDateTime
- DateTime value in string format
-
Set ODABA timestamp from unix timestamp
odaba::DateTime & DateTime  :: assign ( int64 iUnixTime )
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 timestamp value. 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.
to list
- iUnixTime
- Unix time stamp