Processing and displaying dates
GenericsData &
HandleData
To simplify reading, objects of type TimeStamp are described in DataChain and the documentation as Dates (with a capital letter). Values representing dates which are not of type Date (Character string or Numeric) are designated as dates (with a lower case letter). |
Display in DataChain
In order to simplify the reading and manipulation of Dates throughout the value chain, Dates are displayed by default with the simplified ISO 8601 format display mask.
The time zone depends on the parameters of your DataChain instance (UTC by default), contact a DataChain administrator if in doubt.
When hovered, Dates are always displayed in full ISO 8601 format and in UTC, regardless of the display mask applied.
-
Simplified ISO in UTC: 2023-09-01 13:42:24
-
Full ISO in UTC: 2032-09-01T13:42:24:000Z
Handling dates with masks
Various operations can be performed on dates using display, read and write masks.
Read mask
For rapid integration, mapping of a Business Entity, or to convert a DataBlock column at the end of a step, the read mask lets you specify how the manipulated values are to be transformed.
You must specify the read mask to be used when creating a Business Entity from a Repository or during rapid integration.
You must specify the reading mask to be used when Mapping a Business Entity, as well as the time zone and language.
You must specify the reading mask to be used, as well as the time zone and language when you modify the Type of a column at the output of a DataBlock step.
image::dates/DB-convert.svg[DataBlock type change] .Changing the type of a column in a DataBlock
Display mask
When configuring a step output from a DataBlock or a HandleData source, you can modify the display mask to be applied. + The default display mask is in simplified ISO format and in local time. The display mask used by default is in simplified ISO format.
You can also change the time zone and language, if required.
Write mask
2 formulas can be used to transform dates into string format.
-
date.to_strz transforms a date into a character string using a writing mask, a time zone and a language.
-
str.to_datez transforms a String into a Date using a read mask, a time zone and a language
Set time zone and language
You can change the time zone to be used in the display and write masks to specify the time difference to be applied in relation to UTC.
The choice of language allows you to specify the language to be used for masks containing string values (Monday, Tuesday, January, etc.).
Customise masks
The mask can be customised using the accepted values
The most commonly used values are described in the table below. For a full list of accepted values, please refer to Oracle documentation available online.
Value | Rendering | Example |
---|---|---|
D |
Day in year |
156 |
d |
Day of the month |
29 |
EEEE |
Day of the week |
Friday |
Month of the year in two digits |
09 |
MMM |
Abbreviation of the name of the month of the year |
sept. |
MMMM |
Month of the year in full |
September |
yy |
Two-digit year |
23 |
yyyy |
Four-digit year |
2023 |
hh |
24hour |
22 |
HH |
Time in AM/PM format (12h) |
10 |
ss |
Seconds |
42 |
Z |
Using pre-configured mask templates
DataChain offers a number of pre-configured mask templates available for reading, displaying or writing.
Template |
Example |
yyyyMMdd |
20231002 |
ddMMyyyy |
02102023 |
dd/MM/yyyy |
02/10/2023 |
dd-MM-yyyy |
02-10-2023 |
yyyy/MM/dd |
2023/10/02 |
yyyy-MM-dd |
2023-10-02 |
dd/MM/yyyy HH:mm |
02/10/2023 10:42 |
dd-MM-yyyy HH:mm |
02-10-2023 10:42 |
yyyy/MM/dd HH:mm |
2023/10/02 10:42 |
yyyy-MM-dd HH:mm |
2023-02-10 10:42 |
dd/MM/yyyy HH:mm:ss |
02/10/2023 10:42:55 |
dd/MM/yyyy HH:mm:ss.SSS |
02/10/2023 10:42:55.915 |
dd-MM-yyyy HH:mm:ss |
02-10-2023 10:42:55 |
dd-MM-yyyy HH:mm:ss.SSS |
02-10-2023 10:42:55.915 |
yyyy/MM/dd HH:mm:ss |
2023/10/02 10:42:55 |
yyyy/MM/dd HH:mm:ss.SSS |
2023/10/02 10:42:55.915 |
yyyy-MM-dd HH:mm:ss |
2023-10-02 10:42:55 |
yyyy-MM-dd HH:mm:ss.SSS |
2023-10-02 10:42:55.915 |
HH |
10 |
HH:mm |
10:42 |
HH:mm:ss |
10:42:55 |
HH:mm:ss.SSS |
10:42:55.915 |
EEEE dd MM yyyy |
Monday 02 10 2023 |
EEEE dd MMM yyyy |
Monday 02 Oct 2023 |
EEEE dd M yyyy HH’h’mm |
Monday 02 10 2023 10:42 am |
yyyy |
2023 |
EEEE |
monday |
MMMM |
October |
MMMM - yyyy |
oct.-23 |
w - YYYY |
40 - 2023 |
W - MMMM - yyyy |
01-Oct-23 |
EEEE - yyyy |
Monday - 2023 |
EEEE-HH |
Monday-10 |
dd-MM-yyyy HH:mm:ssX |
02-10-2023 10:42:55+02 |
dd-MM-yyyy HH:mm:ssXX |
02-10-2023 10:42:55+0200 |
dd-MM-yyyy HH:mm:ssXXX |
02-10-2023 10:42:55+02:00 |
dd-MM-yyyy HH:mm:ssXXXX |
02-10-2023 10:42:55+0200 |
dd-MM-yyyy HH:mm:ssXXXXX |
02-10-2023 10:42:55+02:00 |
dd-MM-yyyy HH:mm:ss.SSSX |
02-10-2023 10:42:55.955+02 |
dd-MM-yyyy HH:mm:ss.SSSXX |
02-10-2023 10:42:55.955+0200 |
dd-MM-yyyy HH:mm:ss.SSSXXX |
02-10-2023 10:42:55.955+02:00 |
dd-MM-yyyy HH:mm:ss.SSSXXXX |
02-10-2023 10:42:55.955+0200 |
dd-MM-yyyy HH:mm:ss.SSSXXXXX |
02-10-2023 10:42:55.955+02:00 |
yyyy-MM-dd HH:mm:ssX |
2023-10-02 10:42:55+02 |
yyyy-MM-dd HH:mm:ssXX |
2023-10-02 10:42:55+0200 |
yyyy-MM-dd HH:mm:ssXXX |
2023-10-02 10:42:55+02:00 |
yyyy-MM-dd HH:mm:ssXXXX |
2023-10-02 10:42:55+0200 |
yyyy-MM-dd HH:mm:ssXXXXX |
2023-10-02 10:42:55+02:00 |
yyyy-MM-dd HH:mm:ss.SSSX |
2023-10-02 10:42:55.955+02 |
yyyy-MM-dd HH:mm:ss.SSSXX |
2023-10-02 10:42:55.955+0200 |
yyyy-MM-dd HH:mm:ss.SSSXXX |
2023-10-02 10:42:55.955+02:00 |
yyyy-MM-dd HH:mm:ss.SSSXXXX |
2023-10-02 10:42:55.955+0200 |
yyyy-MM-dd HH:mm:ss.SSSXXXXX |
2023-10-02 10:42:55.955+02:00 |
yyyy-MM-dd HH:mm:ss.SSSSSS |
2023-10-02 10:42:55.955441 |
yyyy-MM-dd HH:mm:ss.SSSSSSX |
2023-10-02 10:42:55.955441+02 |
yyyy-MM-dd HH:mm:ss.SSSSSSXX |
2023-10-02 10:42:55.955441+0200 |
yyyy-MM-dd HH:mm:ss.SSSSSSXXX |
2023-10-02 10:42:55.955441+02:00 |
yyyy-MM-dd HH:mm:ss.SSSSSSXXXX |
2023-10-02 10:42:55.955441+0200 |
yyyy-MM-dd HH:mm:ss.SSSSSSXXXXX |
2023-10-02 10:42:55.955441+02:00 |
yyyy-MM-dd HH:mm:ss.SSSSSSSSS |
2023-10-02 10:42:55.955441000 |
yyyy-MM-dd HH:mm:ss.SSSSSSSSSX |
2023-10-02 10:42:55.955441000+02 |
yyyy-MM-dd HH:mm:ss.SSSSSSSSSXX |
2023-10-02 10:42:55.955441000+0200 |
yyyy-MM-dd HH:mm:ss.SSSSSSSSSXXX |
2023-10-02 10:42:55.955441000+02:00 |
yyyy-MM-dd HH:mm:ss.SSSSSSSSSXXXX |
2023-10-02 10:42:55.955441000+0200 |
yyyy-MM-dd HH:mm:ss.SSSSSSSSSXXXXX |
2023-10-02 10:42:55.955441000+02:00 |
yyyy-MM-dd’T’HH:mm:ssX |
2023-10-02T10:42:55+02 |
yyyy-MM-dd’T’HH:mm:ssXX |
2023-10-02T10:42:55+0200 |
yyyy-MM-dd’T’HH:mm:ssXXX |
2023-10-02T10:42:55+02:00 |
yyyy-MM-dd’T’HH:mm:ssXXXX |
2023-10-02T10:42:55+0200 |
yyyy-MM-dd’T’HH:mm:ssXXXXX |
2023-10-02T10:42:55+02:00 |
yyyy-MM-dd’T’HH:mm:ss.SSSX |
2023-10-02T10:42:55.955+02 |
yyyyy-MM-dd’T’HH:mm:ss.SSSXX |
2023-10-02T10:42:55.955+0200 |
yyyyy-MM-dd’T’HH:mm:ss.SSSXXX |
2023-10-02T10:42:55.955+02:00 |
yyyyy-MM-dd’T’HH:mm:ss.SSSXXXX |
2023-10-02T10:42:55.955+0200 |
yyyyy-MM-dd’T’HH:mm:ss.SSSXXXXX |
2023-10-02T10:42:55.955+02:00 |
yyyyy-MM-dd’T’HH:mm:ss.SSSSSSX |
2023-10-02T10:42:55.955441+02 |
yyyyy-MM-dd’T’HH:mm:ss.SSSSSSXX |
2023-10-02T10:42:55.955441+0200 |
yyyyy-MM-dd’T’HH:mm:ss.SSSSSSXXX |
2023-10-02T10:42:55.955441+02:00 |
yyyy-MM-dd’T’HH:mm:ss.SSSSSSXXXX |
2023-10-02T10:42:55.955441+0200 |
yyyyy-MM-dd’T’HH:mm:ss.SSSSSSXXXXX |
2023-10-02T10:42:55.955441+02:00 |
yyyyy-MM-dd’T’HH:mm:ss.SSSSSSSSSXXX |
2023-10-02T10:42:55.955441000+02 |
yyyyy-MM-dd’T’HH:mm:ss.SSSSSSSSSSSXX |
2023-10-02T10:42:55.955441000+0200 |
yyyy-MM-dd’T’HH:mm:ss.SSSSSSSSSSSXXX |
2023-10-02T10:42:55.955441000+02:00 |
yyyyy-MM-dd’T’HH:mm:ss.SSSSSSSSSSSXXXX |
2023-10-02T10:42:55.955441000+0200 |
yyyyy-MM-dd’T’HH:mm:ss.SSSSSSSSSSSXXXX |
2023-10-02T10:42:55.955441000+02:00 |