Switch to: V12V11V10V9V8V7V6V5

Report Editor - Formatting Date and Time Help

You can change output format for following controls, if they represents a date, date time, or time data:

Date Kind

For Date, Time or DateTime data, you can choose one of the common date/time formats using the kind property of a control:

  • Auto – defines auto format for the current control.
  • DateFull – defines the full format of the date, that contains the most widely description of the date.
  • DateLong – defines the long format of the date, that contains more widely description then medium format.
  • DateMedium – defines the medium format of the date, that contains more widely description then short format.
  • DateShort – defines the short format of the date.
  • DatePattern – indicates, that format for date should be defined through pattern.

EXAMPLE:

In the following table you can see how each format displays date 10 Sept 2012.

Auto DateFull DateLong DateMedium DateShort DatePattern (yyyy.MMM.dd 'at' hh:mm:ss zzzz)
Date Format - AutoDate Format - FullDate Format - LongDate Format - MediumDate Format - ShortDate Format - Pattern

Date Pattern

Valentina Report engine allows to format date according to a specified pattern. You can get acquainted with the principles of date formatting in the official page of Icu Library. Here you can find basic rules of compilation patterns, and examples of available patterns.

A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a source field or expression control.

The Date Field Symbol Table below contains the characters used in patterns to show the appropriate formats for a given locale, such as yyyy for the year. Characters may be used multiple times. For example, if y is used for the year, 'yy' might produce '99', whereas 'yyyy' produces '1999'. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, 'h' might produce '5', but 'hh' produces '05'. For some characters, the count specifies whether an abbreviated or full form should be used, but may have other choices, as given below.

Two single quotes represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (except for two adjacent single quotes). Otherwise all ASCII letter from a to z and A to Z are reserved as syntax characters, and require quoting if they are to represent literal characters. In addition, certain ASCII punctuation characters may become variable in the future (eg “:” being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display).

“Stand Alone” values refer to those designed to stand on their own, as opposed to being with other formatted values. “2nd quarter” would use the stand alone format (QQQQ), whereas “2nd quarter 2007” would use the regular format (qqqq yyyy).

Date Field Symbol Table

SymbolMeaningExample
Gera designatorGAD
yyearyy
yyyy or y
96
1996
Yyear of “Week of Year”Y1997
uextended yearu4601
QquarterQ or QQ
QQQ
QQQQ
02
Q2
2nd quarter
qStand Alone quarterq or qq
qqq
qqqq
02
Q2
2nd quarter
Mmonth in yearM or MM
MMM
MMMM
MMMMM
09
Sept
September
S
LStand Alone month in yearL or LL
LLL
LLLL
LLLLL
09
Sept
September
S
wweek of yearw or ww27
Wweek of monthW2
dday in monthd
dd
2
02
Dday of yearD189
Fday of week in month 2 (2nd Wed in July)
gmodified julian dayg2451334
Eday of weekE, EE, or EEE
EEEE
EEEEE
Tues
Tuesday
T
elocal day of week
example: if Monday is 1st day, Tuesday is 2nd )
e or ee
eee
eeee
eeeee
2
Tues
Tuesday
T
cStand Alone local day of weeke or ee
eee
eeee
eeeee
2
Tues
Tuesday
T
aam/pm markerapm
hhour in am/pm (1~12)h
hh
7
07
Hhour in day (0~23)H
HH
0
00
khour in day (1~24)k
kk
24
24
Khour in am/pm (0~11)K
KK
0
00
mminute in hourm
mm
4
04
ssecond in minutes
ss
5
05
Smillisecond
rounds to count of letters)
S
SS
SSS
SSSS
2
24
235
2350
Amilliseconds in dayA61201235
zTime Zone: specific non-locationz, zz, or zzz
zzzz
PDT
Pacific Daylight Time
ZTime Zone: RFC 822
Time Zone: localized GMT
Z, ZZ, or ZZZ
ZZZZ
-0800
GMT-08:00
vTime Zone: generic non-locationv
vvvv
PT
Pacific Time or United States (Los Angeles)
VTime Zone: generic non-locationVPT
VVVVTime Zone: generic locationVVVVUnited States (Los Angeles)
Wweek in month 2
'escape for text'(nothing)
' 'two single quotes produce one' ''

Examples

Let's consider few examples of how will be presented date 07/07/2012 12:30:45:765, using several patterns:

Pattern Output
yyyy.MM.dd G 'at' HH:mm:ss zzz 2012.07.07 AD at 12:30:45 GMT+03:00
h:mm a 12:30 PM
EEE, MMM d, ''yy Sat, Jul 7, '12
hh 'o''clock' a, zzzz 12 o'clock PM, Eastern European Summer Time
K:mm a, z 0:30 PM, GMT+03:00
yyyyy.MMMM.dd GGG hh:mm aaa 02012.July.07 AD 12:30 PM
MMMM yyyy July 2012
'the' D 'day of' yyyy 'year' the 189 day of 2012 year
LLL yy, EEEE Jul 12, Saturday
LLL''yy hh:mm:ss a Jul'12 12:30:45 PM