Date « JSTL « JSP-Servlet Q&A





1. In JSTL/JSP, given a java.util.Date, how do I find the next day?    stackoverflow.com

On a JSTL/JSP page, I have a java.util.Date object from my application. I need to find the day after the day specified by that object. I can use <jsp:scriptlet> to drop ...

2. Showing the current date using JSTL formatDate tag    stackoverflow.com

I am trying to show the current date in my JSP page using JSTL. below is the code I am using.

<jsp:useBean id="now" class="java.util.Date" scope="request" />
<fmt:formatDate value="${now}" pattern="MM.dd.yyyy" />
But the above code ...

3. Is it possible to use JSTL to display a date in the client's timezone?    stackoverflow.com

In Javascript, I have this function to display the current date on our page header:

<SCRIPT language="Javascript">
    var today = new Date();
    document.write(today.toLocaleDateString());
</SCRIPT>
I would like to ...

4. Handling unparseable strings in a JSP date formatter    stackoverflow.com

I'm writing a JSP that sometimes needs to format a Java Date that comes out of the request. I'm doing it like this:

<fmt:formatDate value="${attribute.value}" pattern="yyyy-MM-dd HH:mm:ss"/>
and it works beautifully on Java ...

5. How to display a date as ISO8601 with JSTL?    stackoverflow.com

something like?

<fmt:formatDate value='${event.starttime}' type='both'/>

6. Why does this PrettyTime custom tag produce 11 lines of blank text before the "pretty" date in the HTML output?    stackoverflow.com

<%@ tag language="java" pageEncoding="utf-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ tag import="com.ocpsoft.pretty.time.PrettyTime, java.util.Date"%>
<%@ attribute name="dateParam" required="true" type="java.util.Date" %>

<%
 PrettyTime p = new PrettyTime();
 ...

7. Is it possible to create a date value in Expression Language?    stackoverflow.com

Is it possible to create a date value in JSTL Expression Language (EL) without using scriptlets? Here is a snippet of some of the legacy code I'm trying to refactor to ...

8. JSTL EL Date Arithmetic    stackoverflow.com

Without using scriptlets, what's the best practice for doing date arithmetic. Here is some pseudo-code of what I'm trying to do:

  1. Get Current Year (YYYY)
  2. Subtract current year by one to get previous Year ...

9. Looking for JSTL Taglib calculate seconds between two dates    stackoverflow.com

I'm looking for a taglib to use for calculating how many seconds there was between two dates.





10. Using JSTL's formatDate function with a date represented in milliseconds    stackoverflow.com

Normally I use the following to display a Date object in a JSP page:

<fmt:formatDate value="${blogEntry.created}"/>
Works great if blogEntry.created is a java.util.Date object. But what's the proper way to display a ...

11. Present today's date as "Today" rather than "dd/mm/yyyy" in a JSP    stackoverflow.com

Given a java.util.Date, what's the best way to display the date as Today rather than in some version of dd/mm/yyyy in a JSP? Given a future date, I'd still like it to ...

12. Automatic conversion from string to date in JSP    stackoverflow.com

I am not sure why the following code works: str is a date in the format 2011-11-04 15:54:48.38. It is a string. When executing the following code:

<fmt:parseDate var="xxx" type="date" pattern="y-M-d H:m:s" value="${str}" />
xxx: ...

13. JSTL null date problem    coderanch.com

14. JSTL Date Range Question    coderanch.com

I am using JSTL to parse an xml feed (news articles) and need to restrict the articles I get back in the xml to todays date. On another page I am working on I have to restrict the articles to todays date - 7 days (one week). The date I have to restrict on in the xml feed is called . ...

15. jstl reformat date    coderanch.com

16. getting Date out with JSTL    coderanch.com





17. jstl reformat date exception    coderanch.com

Hi all, I am having bit trouble formating date using jstl. I am using JSTL1.1 standard.jar and JSTL1.1 jstl.jar and stack trace is 22-Oct-2007 16:18:53 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception javax.servlet.jsp.el.ELException: Attempt to convert String "2007-08-13" to type "java.util.Date", but there is no PropertyEditor for that type at org.apache.commons.el.Logger.logError(Logger.java:481) at org.apache.commons.el.Logger.logError(Logger.java:498) at org.apache.commons.el.Logger.logError(Logger.java:566) ...

18. Problem with JSTL date    coderanch.com

19. jstl miliseconds to Date    coderanch.com

20. JSTL way to get a date + 3 months?    coderanch.com

21. JSP Last Modified Date    java-forums.org

I have to code the last modified date of the index page on our site using JSP. I have looked on the internet but have been unsuccessful at finding a good example. Would anyone happen to know of a good example to follow for my particular program or have any ideas? Thanks a lot E

22. Listing info by date    java-forums.org

Hi. I am trying to loop over data from my db to produce a listing and header similar to craigslist posting. I need to display all items listed for date "such and such" and then go to the next previous date and do the same thing. Java Code: SELECT * FROM gmlistmain ORDER BY datePosted ASC ...

23. Display nodes depending on date    java-forums.org

24. insert date    java-forums.org

25. Check date using jstl    java-forums.org

Please Help, I need to do the following: I've mixed a bit of code and pseudo code here, hope somebody can fill in the pseudocode for me.

No ...