Legacy Messaging Functions

Legacy Messaging Compatibility Functions

The AMPS distribution includes a library of legacy messaging compatibility functions. These functions are intended to ease migration to AMPS from legacy messaging systems that provide similar functions.

In this release, the legacy messaging functions provide functions to make it easy to work with date and time.

These functions are not loaded into AMPS by default. To enable them, you must load the legacy messaging compatibility module by adding a directive to the AMPS configuration file. Once the module is loaded, the functions become available. No further configuration is required.

For example, adding the following configuration item to the Modules block of the AMPS configuration file loads the legacy messaging compatibility functions.

<AMPSConfig>
    ...

    <Modules>
        ...

        <Module>
            <Name>compatibility-functions-module</Name>
            <Library>libamps_udf_legacy_compatibility.so</Library>
        </Module>

    </Modules>

</AMPSConfig>
FunctionParametersDescription

TIMEZONEOFFSET

(none)

Returns a long that contains the current timezone offset from UTC, represented in seconds.

YEAR

timestamp

Returns the year for the provided timestamp. The year is calculated in the UTC timezone.

For example, calling YEAR on a timestamp that represents January 25, 2010 at 10:04 AM in UTC returns 2010.

MONTH

timestamp

Returns the month for the provided timestamp. The month is calculated in the UTC timezone.

For example, calling MONTH on a timestamp that represents January 25, 2010 at 10:04 AM in UTC returns 1.

DAY

timestamp

Returns the day for the provided timestamp. The day is calculated in the UTC timezone.

For example, calling DAY on a timestamp that represents January 25, 2010 at 10:04 AM in UTC returns 25.

DATE_UTC

timestamp

Returns a timestamp for the beginning of the provided day (00:00:00) in UTC.

The timestamp is represented in seconds.

DATE

timestamp

Returns the UNIX timestamp for the beginning of the provided day (00:00:00) in the local timezone.

The timestamp is represented in seconds.

TODAY_UTC

(none)

Returns the UNIX timestamp for the beginning of the current day (00:00:00) in UTC -- that is, the local timestamp that corresponds to the UTC time for the start of the current day.

The timestamp is represented in seconds.

TODAY

(none)

Returns the UNIX timestamp for the beginning of the current day (00:00:00) in the local timezone.

The timestamp is represented in seconds.

Last updated

Copyright 2013-2024 60East Technologies, Inc.