d Conversion Character
Reports the date of the log event.
Alias: |
date |
Default: |
ISO8601 format, which is represented as yyyy-MM-dd HH:mm:ss,SSS |
Requirement: |
If the date conversion specifier is used, it must be
enclosed in a pair of braces.
|
Tip: |
The d conversion character formats three digits for the
precision of milliseconds, regardless of the number of S simple date
format characters that are specified, and regardless of the machine
precision of the timing that is available.
|
Syntax
d [ {date-conversion-specifier} ]
Optional Argument
- date-conversion-specifier
-
specifies the format
of the date. Here are the supported date conversion
specifiers:
- ABSOLUTE
-
specifies the time
in the format HH:mm:ss,SSS.
- DATE
-
specifies the date
and time in the format dd MMM yyyy HH:mm:ss,SSS.
Example |
06 Nov 2010 15:49:37,459 |
- ISO8601
-
specifies the date
and time in the format yyyy-MM-dd HH:mm:ss,SSS. An example is
Example |
2011-11-27 15:49:37,459 |
- Simple Date Format
-
specifies a date in
the form of a string that can contain any of these sets of characters:
aa: a.m. or p.m. marker
(string)
|
FF: Day of week in month
(numeric)
|
dd: Day in month (numeric)
|
GG: Era designator (string
"AD")
|
hh: Hour in a.m. or
p.m. (numeric 1-12)
|
HH: Hour in day (numeric
0-23)
|
mm: Minute in hour (numeric)
|
KK: Hour in a.m. or
p.m. (numeric 0-11)
|
ss: Second in minute
(numeric)
|
MM: Month in year (numeric
1-12)
|
yy: Two-digit year (numeric)
|
MMM: Month in year (abbreviated
string)
|
yyyy: Four-digit year
(numeric)
|
MMMM: Month in year
(string)
|
|
SSS: Millisecond (numeric)
|
DD: Day in year (numeric)
|
Z: RFC 822 Time Zone
(string)
|
EE: Day in week (abbreviated
string)
|
' literal string within single quotation marks '
|
EEEE: Day in week (string)
|
|
Example
Here are examples of
the d conversion character:
d{EEEE MMMM yyyy HH:mm:ss,SSS
'Ship date'}