Date Examples
These example calculated attributes are written to use the data defined in the following tables.
For function syntax information and more detailed use cases, refer to the Date Functions documentation here.
These example calculated attributes are written to use a product with the attribute data defined in the following table.
Product ID |
AttrDateID |
StartDate (ISO Date) |
---|---|---|
P1id |
2016-10-15 |
|
P2id |
1997-12-25 |
|
P3id |
2016-05-15 |
|
P4id |
|
2017-03-13 |
After creating the data above, open the Function Editor. Copy and paste any of the Value Template text below into the Function Editor, select the Object identified, and click the Evaluate button to display the defined Result.
Value Template |
Object |
Result |
---|---|---|
formatdatetime(prodval('AttrDateid'), "EEE, MMM d, ''yy") |
P1id |
Fri, Oct 15, '16 |
formatdatetime(prodval('AttrDateid'), "yyyyy.MMMMM.dd" ) |
P2id |
01997.December.25 |
formatdatetime(prodval('AttrDateid'), "MMM d, yy" ) |
P3id |
May 15, 16 |
localizedate(prodval('AttrDateid')) |
P3id when in Danish context |
15-05-2016 |
now() |
any when executed on 4 MAY 2016 just after midday |
2016-05-04 12:06:25 |
{d := value('StartDate'), x := localizedate(d, "en_GB"), y := localizedate(d, "en_US"), z := localizedate(d, "de_DE") } concatenate(d, "; ", x, "; ", y, "; ", z) |
P4id |
2017-03-13; 13-Mar-2017; Mar 13, 2017; 13.03.2017 |