company logo

DateTime :: toUnixTime - Get unix timestamp from ODABA date/time value

The function returns a Unix timestamp from the date value, which is the time in seconds passed since 1.1.1970. The value returned is either the local time distance or the the time distance to GMT time.

Return value:  Unix time stamp ( int64  )

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.

Implementation overview

Implementation details

  1. Get unix timestamp from ODABA date/time value
    int64 DateTime  :: toUnixTime ( bool bLocalTime )

    When true has been passed in bLocalTime, the value is considered as local time and will be converted to Greenwich standard time (UTC). Conversion may alter the date/time value returned. In case of conversion, the function throws an exception, when the date is less than 1.1.1970,

    When passing false in bLocalTime, no conversion takes place and it is up to the application interpreting the value as local or standard time. In this case, the function returns a negative value, when the date is less than 1.1.1970.

    • bLocalTime - Local or standard time

      The option indicates, that a time value or timestamp contains local time (true) or Greenwich standard time (false).

  2. to list
  3. Get unix timestamp
    int64 DateTime  :: toUnixTime (  )

    The date/time value is considered as local time and will be converted to Greenwich standard time (UTC). Conversion may alter the date value returned. The function throws an exception, when the (result) date is less than 1.1.1970,


  4. to list