Jsp-jstl-format-formatdate-tag
提供:Dev Guides
JSTL-コア<fmt:formatDate>タグ
属性
Attribute | Description | Required | Default |
---|---|---|---|
Value | Date value to display | Yes | None |
type | DATE, TIME, or BOTH | No | date |
dateStyle | FULL, LONG, MEDIUM, SHORT, or DEFAULT | No | default |
timeStyle | FULL, LONG, MEDIUM, SHORT, or DEFAULT | No | default |
pattern | Custom formatting pattern | No | None |
timeZone | Time zone of the displayed date | No | Default time zone |
var | Name of the variable to store the formatted date | No | Print to page |
scope | Scope of the variable to store the formatted date | No | page |
パターン属性は、日付のより正確な処理を指定するために使用されます-
Code | Purpose | Sample |
---|---|---|
G | The era designator | AD |
y | The year | 2002 |
M | The month | April & 04 |
d | The day of the month | 20 |
h | The hour(12-hour time) | 12 |
H | The hour(24-hour time) | 0 |
m | The minute | 45 |
s | The second | 52 |
S | The millisecond | 970 |
E | The day of the week | Tuesday |
D | The day of the year | 180 |
F | The day of the week in the month | 2 (2nd Wed in month) |
w | The week in the year | 27 |
W | The week in the month | 2 |
a | The a.m./p.m. indicator | PM |
k | The hour(12-hour time) | 24 |
K | The hour(24-hour time) | 0 |
z | The time zone | Central Standard Time |
' | The escape for text | |
The single quote |
例
上記のコードは、次の結果を生成します-