I haven't played with that specific tag too much, but maybe it's not
even working right in the first line? That date output is the default
for printing out a date, so it doesn't look formatted to me :/
You may be right about the Date vs Timestamp issue, I know that
Timestamp has slightly higher precision so that may be causing the
problem. As a possible alternative you can try some ways of converting
the Timestamp into a Date, such as 'new Date(Timestamp.getTime())'.
-- Allen
Emily Lynema wrote:
I'm trying to reformat the post date/times that appear on our roller
main page.
I'm still on roller 2.1, so I apologize for being a bit behind. We are
running in Apache Tomcat 5.5.17 with Java 1.5.
Here's the original code in the main.jsp for each 'recent post':
<fmt:formatDate value="${post.pubTime}" type="both" dateStyle="medium"
timeStyle="medium" />
which produces a display like this:
2007-01-05 10:06:54.0
I would like it to display something more like 'January 5, 2007' without
the timestamp. But no matter how I fiddle with the <fmt:formatDate />
options, I can't get anything to change.
For example, this code:
<fmt:formatDate value="${post.pubTime}" type="date" dateStyle="full" />
continues to produce:
2007-01-05 10:06:54.0
The formatDate tag, as far as I can find, seems to be expecting a
java.util.Date, and the WeblogEntryData.pubTime seems to be a
java.sql.Timestamp, so I'm wondering if there are incompatabilities
there. Any advice would be appreciated!
-emily