• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple way to get the current date/time into a JSP output  RSS feed

 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that's simple enough
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I love simple!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!