Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Current »

Scope of this page : dateFormat, dateTimeFormat, dateLocale

The input format of the provided date or date / time string needs to be in ISO8601 Format.

Date / Date Time Fields (Chapter from Template v2)

Formatting date or date and time strings is supported through a built in $date() function.

{{date <date/time string> [format=pattern]}}

The shortcut function today can be used to display the current date or date time.

{{today [format=pattern]}}

The provided date/time string needs to be in ISO 8601 format. For example:

β€˜2018-04-04T16:00:00.000Z'
'2018-04-13 19:18:17.040+02:00'
'2018-04-13 19:18'
'2018-04-13’

The format pattern is optional and needs to follow the date formatting specification described here. If no format pattern is provided the format pattern from the provided json configuration or the default pattern will be used. for example:

{{date createdDate}}

{{dateTime createdDateTime}}

{{dateTime createdDateTime format="D.M.YYYY hh:mm:ss"}}

{{today format="D.M.YYYY hh:mm:ss"}}

Date formatting

To specify the output date or date and time format the following symbols can be used:

Input

Example

Description

YY

1

Two-digit year

YYYY

2001

Four-digit year

M

1-12

Month, beginning at 1

MM

01-12

Month, 2-digits

MMM

Jan-Dec

The abbreviated month name

MMMM

January-December

The full month name

D

1-31

Day of month

DD

01-31

Day of month, 2-digits

H

0-23

Hours

HH

00-23

Hours, 2-digits

h

1-12

Hours, 12-hour clock

hh

01-12

Hours, 12-hour clock, 2-digits

m

0-59

Minutes

mm

00-59

Minutes, 2-digits

s

0-59

Seconds

ss

00-59

Seconds, 2-digits

S

0-9

Hundreds of milliseconds, 1-digit

SS

00-99

Tens of milliseconds, 2-digits

SSS

000-999

Milliseconds, 3-digits

Z

-5:00:00

Offset from UTC

ZZ

-500

Compact offset from UTC, 2-digits

A

AM PM

Post or ante meridiem, upper-case

a

am pm

Post or ante meridiem, lower-case

Do

1st... 31st

Day of Month with ordinal

X

1410715641

Unix timestamp

x

1410715640579

Unix ms timestamp

Locale

To set the language for date formats including day or month names, a dateLocale can be passed to IdealDoc. The default dateLocale is English β€œen”. The following formats are supported:

Locale Code

Locale Name

af

Afrikaans

ar-dz

Arabic (Algeria)

am

Amharic

ar-iq

Arabic (Iraq)

ar-kw

Arabic (Kuwait)

ar-ly

Arabic (Libya)

ar-ma

Arabic (Morocco)

ar-sa

Arabic (Saudi Arabia)

ar-tn

Arabic (Tunisia)

ar

Arabic

az

Azerbaijani

be

Belarusian

bg

Bulgarian

bm

Bambara

bi

Bislama

bn-bd

Bangla (Bangladesh)

bn

Bangla

bo

Tibetan

br

Breton

bs

Bosnian

ca

Catalan

cs

Czech

cv

Chuvash

cy

Welsh

da

Danish

de-at

German (Austria)

de-ch

German (Switzerland)

de

German

dv

Maldivian

el

Greek

en-au

English (Australia)

en-ca

English (Canada)

en-gb

English (United Kingdom)

en-ie

English (Ireland)

en-il

English (Israel)

en-in

English (India)

en-nz

English (New Zealand)

en-sg

English (Singapore)

en-tt

English (Trinidad & Tobago)

eo

Esperanto

en

English

es-do

Spanish (Dominican Republic)

es-mx

Spanish (Mexico)

es

Spanish

et

Estonian

eu

Basque

fa

Persian

fi

Finnish

fi

TBD

fr-ca

TBD

fr-ch

TBD

fr

TBD

fy

TBD

ga

TBD

gd

TBD

gl

TBD

gom-latn

TBD

gu

TBD

he

TBD

hi

TBD

hr

TBD

ht

TBD

hu

TBD

hy-am

TBD

id

TBD

it-ch

TBD

is

TBD

ja

TBD

it

TBD

ka

TBD

jv

TBD

kk

TBD

km

TBD

ko

TBD

kn

TBD

ku

TBD

ky

TBD

lb

TBD

lo

TBD

lv

TBD

lt

TBD

me

TBD

mi

TBD

mk

TBD

ml

TBD

mn

TBD

mr

TBD

ms-my

TBD

ms

TBD

mt

TBD

my

TBD

nb

TBD

ne

TBD

nl-be

TBD

nn

TBD

nl

TBD

pa-in

TBD

oc-lnc

TBD

pt-br

TBD

pl

TBD

pt

TBD

rn

TBD

ro

TBD

ru

TBD

rw

TBD

es-us

TBD

es-pr

TBD

sd

TBD

se

TBD

si

TBD

sk

TBD

sl

TBD

sq

TBD

sr-cyrl

TBD

sr

TBD

ss

TBD

sv-fi

TBD

sv

TBD

sw

TBD

te

TBD

ta

TBD

tet

TBD

tg

TBD

tk

TBD

tl-ph

TBD

tlh

TBD

th

TBD

tr

TBD

tzl

TBD

tzm-latn

TBD

tzm

TBD

ug-cn

TBD

uk

TBD

ur

TBD

uz-latn

TBD

uz

TBD

vi

TBD

x-pseudo

TBD

yo

TBD

zh-cn

TBD

zh-hk

TBD

z h-tw

TBD

zh

TBD

  • No labels