====== 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: * [[.:..:controls:field|Field Control]] * [[.:..:controls:controls#text_controls|Expression Field]] * [[.:..:controls:date | Date Field]] * [[.:..:controls:datetime | DateTime Field]] * [[.:..:controls:time | Time Field]] ===== 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) ^ |{{:valentina:products:vstudio:picts:vs_reports_controls_example_date_format_auto.png|Date Format - Auto}}|{{:valentina:products:vstudio:picts:vs_reports_controls_example_date_date_full.png|Date Format - Full}}|{{:valentina:products:vstudio:picts:vs_reports_controls_example_date_date_long.png|Date Format - Long}}|{{:valentina:products:vstudio:picts:vs_reports_controls_example_date_medium.png|Date Format - Medium}}|{{:valentina:products:vstudio:picts:vs_reports_controls_example_date_short.png|Date Format - Short}}|{{:valentina:products:vstudio:picts:vs_reports_controls_example_date_date_pattern.png|Date 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 [[http://userguide.icu-project.org/formatparse/datetime|Icu Library]]. Here you can find basic rules of compilation patterns, and [[formatting#examples|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 ==== ^Symbol^Meaning^Example^^ |G|era designator|G|AD| |y|year|yy
yyyy or y|96
1996| |Y|year of "Week of Year"|Y|1997| |u|extended year|u|4601| |Q|quarter|Q or QQ
QQQ
QQQQ|02
Q2
2nd quarter| |q|**Stand Alone** quarter|q or qq
qqq
qqqq|02
Q2
2nd quarter| |M|month in year|M or MM
MMM
MMMM
MMMMM|09
Sept
September
S| |L|Stand Alone month in year|L or LL
LLL
LLLL
LLLLL|09
Sept
September
S| |w|week of year|w //or// ww|27| |W|week of month|W|2| |d|day in month|d
dd|2
02| |D|day of year|D|189| |F|day of week in month| |2 (2nd Wed in July)| |g|modified julian day|g|2451334| |E|day of week|E, EE, or EEE
EEEE
EEEEE|Tues
Tuesday
T| |e|local day of week
example: if Monday is 1st day, Tuesday is 2nd ) |e or ee
eee
eeee
eeeee|2
Tues
Tuesday
T| |c|Stand Alone local day of week|e or ee
eee
eeee
eeeee|2
Tues
Tuesday
T| |a|am/pm marker|a|pm| |h|hour in am/pm (1~12)|h
hh|7
07| |H|hour in day (0~23)|H
HH|0
00| |k|hour in day (1~24)|k
kk|24
24| |K|hour in am/pm (0~11)|K
KK|0
00| |m|minute in hour|m
mm|4
04| |s|second in minute|s
ss|5
05| |S|millisecond
rounds to count of letters)|S
SS
SSS
SSSS|2
24
235
2350| |A|milliseconds in day|A|61201235| |z|Time Zone: specific non-location|z, zz, or zzz
zzzz|PDT
Pacific Daylight Time| |Z|Time Zone: RFC 822
Time Zone: localized GMT|Z, ZZ, or ZZZ
ZZZZ|-0800
GMT-08:00| |v|Time Zone: generic non-location|v
vvvv|PT
Pacific Time or United States (Los Angeles)| |V|Time Zone: generic non-location|V|PT| |VVVV|Time Zone: generic location|VVVV|United States (Los Angeles)| |W|week 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%% |