954,174 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

date time issue in JSP

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...

saiteja
Newbie Poster
3 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

help me in this issue

saiteja
Newbie Poster
3 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 
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

cheenu78
Light Poster
45 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

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

saiteja
Newbie Poster
3 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

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

cheenu78
Light Poster
45 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

hi saiteja,

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

I used jstl library to do that.

Hope this helps.

Srinivas

cheenu78
Light Poster
45 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You