company logo

DateTime :: assign - Set timestamp value

The function provides different ways for setting a timestamp value.

Return value:  Time stamp ( odaba::DateTime & )

A time stamp combines date and time

Implementation overview

Implementation details

  1. Create an empty timestamp
    odaba::DateTime & DateTime  :: assign (  )

    The function initializes the timestamp with an empty value.

  2. to list
  3. 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.

  4. to list
  5. 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

  6. to list
  7. 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).

  8. to list
  9. 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

  10. to list
  11. 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.

  12. to list