• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

<fmt:formatDate question.

 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Oracle appserver from jdeveloper 10.1.3.3

My jsp has a license object with a reference to a java.util.Date object (effectiveDate) The following line of code gives me "Effective Date: Sat Jan 01 00:00:00 PST 2005"



I am trying to format the license date to display the date in "yyyy-MM-dd" format but the following all return an empty string.

<fmt:formatDate type='both' pattern='yyyy-MM-dd' var='${license.effectiveDate}' />

or

<fmt:formatDate type='both' pattern='yyyy-MM-dd' value='${license.effectiveDate}' />

or

<fmt:formatDate value='${license.effectiveDate}' pattern='yyyy-MM-dd' />
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you look at the generated HTML? Is the tag getting evaluated?
 
peter cooke
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the HTML returns the following where I would expect to see "2006-01-05"



Interesting that it does not seem to be executing the tag
 
Bear Bibeault
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Checking the HTML source should be a reflex when this sort of things happen.

Did you declare the fmt library on the page? Guessing not.
 
peter cooke
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Checking the HTML source should be a reflex when this sort of things happen.

Did you declare the fmt library on the page? Guessing not.



Lesson Learned. Thanks.
I have been out of the front end game for a number of years. Any other reflex's I should follow.
 
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic