944,198 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 9408
  • JSP RSS
Jun 21st, 2005
0

date time issue in JSP

Expand Post »
hi..
I reached to the end of my project..but still struggling with date time issue in JSP...
I am using mysql as database...
simply to say my question is, how to insert and retrive datetime from database to my JSP page...can anyone put the code for that..i will be the most happiest...
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
saiteja is offline Offline
3 posts
since Jun 2005
Jun 30th, 2005
0

Re: date time issue in JSP

help me in this issue
Reputation Points: 10
Solved Threads: 0
Newbie Poster
saiteja is offline Offline
3 posts
since Jun 2005
Jun 30th, 2005
0

Re: date time issue in JSP

Quote originally posted by saiteja ...
help me in this issue
hi saiteja,

I am not clear. I am also using mysql as database in my jsp pages. What kind of problem are you facing with date and timestamp?

regard
Srinivas
Reputation Points: 10
Solved Threads: 0
Light Poster
cheenu78 is offline Offline
45 posts
since Jun 2005
Jul 1st, 2005
0

Re: date time issue in JSP

When I retrieve the date time field from my database I am getting only date but not time..
In my database the datetime field is 2005-07-01 12:12:08
But I am getting only 2005-07-01
help me plzzz
Reputation Points: 10
Solved Threads: 0
Newbie Poster
saiteja is offline Offline
3 posts
since Jun 2005
Jul 6th, 2005
0

Re: date time issue in JSP

hi saiteja,
Sorry for the delayed reply, I was out of station.
Are using getTimestamp() of ResultSet if you are using PreparedStatement. If you are using Hibernate you can try typecasting to Timestamp.
can you give me the database structure and the code snippet you are using, I can try and get back to you.
Regards
Srinivas
Reputation Points: 10
Solved Threads: 0
Light Poster
cheenu78 is offline Offline
45 posts
since Jun 2005
Jul 7th, 2005
0

Re: date time issue in JSP

hi saiteja,

Following was the code that I used in jsp to display the date and time:

I used jstl library to do that.

<fmt:formatDate type="date" value="+<%=variableName>+"/>

Hope this helps.

Srinivas
Reputation Points: 10
Solved Threads: 0
Light Poster
cheenu78 is offline Offline
45 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: Howto Setup Backup Server and Copy WebApp
Next Thread in JSP Forum Timeline: Java Server Faces help!!!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC