Open topic with navigation

TIBCO ActiveSpaces® - Enterprise Edition 5.0.0

# Date and Time Functions

ActiveSpaces supports several date and time functions. The date and time functions return either a string or a double.

The following is the list of date and time functions supported.

Date and Time Function | Returns
--- | ---
date(timevalue[, modifier[, modifier, …]]) | The date as a string in the format YYYY-MM-DD
time(timevalue[, modifier[, modifier, …]]) | The time as a string in the format HH:MM:SS
datetime(timevalue[, modifier[, modifier, …]]) | The date and time as a string in the format YYYY-MM-DD HH:MM:SS
julianday(timevalue[, modifier[, modifier, …]]) | The number of days since noon in Greenwich on November 24, 4714 B.C as a double.

The date and time functions can act on the values of columns that have been defined as one of the following data types: `string`, `double`, `long`, and `datetime`. The following table shows how each of the data types represents date and time:

Data Type | Representation of Date and Time
--- | ---
`string` | ISO_8601 strings. For example, "YYYY-MM-DD HH:MM:SS.SSS"
`double` | Julian day numbers, the number of days since noon in Greenwich on November 24, 4714 B.C. according to the proleptic Gregorian calendar
`long` | (default) as Julian day numbers. See type double in the earlier row.
`long` | Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC
`datetime` | two 64-bit integers; one for the number of seconds since January 1, 1970 (Unix epoch), and one for the number of nanoseconds after the time that the `sec` component denotes.

By default, a column of type long is treated as a Julian day number. A column of type long can also be used to hold Unix time values (for example, the number of seconds since 1970-01-01 00:00:00 UTC). When using a date and time function on a column of type long that holds Unix time values, the ‘unixepoch’ modifier must follow the column name in the parameters passed to the function otherwise the column value is interpreted as a Julian day. See Modifiers.

The following are examples of using the date 2016-12-24 00:00:00 as values in the different column types:

- `string - "2016-12-24T00:00:00"`. For more information, see timevalue Format.
- `double - 2457746.50000`
- `long - 1482566400 (Unix time)`
- `datetime - [1482566400, 0]`

Subtopics

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO ActiveSpaces® - Enterprise Edition

Copyright © 2009-2025. Cloud Software Group, Inc. All Rights Reserved.