| Author |
Simple way to get the current date/time into a JSP output
|
Pat Farrell
Rancher
Joined: Aug 11, 2007
Posts: 4422
|
|
I want to display the current date/time in a JSP page. I'd like it to be formatted in the proper style for the current locale.
It looks like the taglib function "fmt:formatDate" is the right place to look, but I don't see a good place to get the
value. Clearly for some "niceDate" this will work
<fmt:formatDate value="${niceDate}" pattern="M"/>
But I don't see a good place to get a date. There clearly is a date time in the HTTP response's header, specifically something like
Date Mon, 31 May 2010 22:12:41 GMT
But I am not having luck finding how to get that into the JSP/EL context.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56185
|
|
|
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Pat Farrell
Rancher
Joined: Aug 11, 2007
Posts: 4422
|
|
|
Thanks, that's simple enough
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56185
|
|
|
I love simple!
|
 |
 |
|
|
subject: Simple way to get the current date/time into a JSP output
|
|
|