File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic

coverting a string object to a Date object

 
Kevin Brewer
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am trying to convert a string into a integer of the Calendar object. I get an error in the following code, could anyone help
<%
String s ="<content:collection-modifie-date/>";
SimpleDateFormat formatter = new SimpleDateFormat();
Date theDate = formatter.parse(s);
Calendar theCalendar = formatter.getCalendar();
theCalendar.setTime(theDate);
int dayOFYear = theCalendar.get(Calendar.DAY_OF_YEAR);
%>
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Can you share the error with us?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
You also posted a duplicate in the JSP forum which has been moved here in the Java in General (intermediate) forum.
I'm going to close this thread, people who want to help should see the other thread.
Please don't post the same question in multiple forums. It creates duplicate conversations and wastes the time of the people trying to help you.
Dave.
 
    Bookmark Topic Watch Topic
  • New Topic