User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 363,556 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,888 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 6062 | Replies: 5
Reply
Join Date: Jun 2005
Posts: 3
Reputation: saiteja is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
saiteja saiteja is offline Offline
Newbie Poster

date time issue in JSP

  #1  
Jun 21st, 2005
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...
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2005
Posts: 3
Reputation: saiteja is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
saiteja saiteja is offline Offline
Newbie Poster

Re: date time issue in JSP

  #2  
Jun 30th, 2005
help me in this issue
Reply With Quote  
Join Date: Jun 2005
Location: india
Posts: 44
Reputation: cheenu78 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
cheenu78's Avatar
cheenu78 cheenu78 is offline Offline
Light Poster

Re: date time issue in JSP

  #3  
Jun 30th, 2005
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
Reply With Quote  
Join Date: Jun 2005
Posts: 3
Reputation: saiteja is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
saiteja saiteja is offline Offline
Newbie Poster

Re: date time issue in JSP

  #4  
Jul 1st, 2005
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
Reply With Quote  
Join Date: Jun 2005
Location: india
Posts: 44
Reputation: cheenu78 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
cheenu78's Avatar
cheenu78 cheenu78 is offline Offline
Light Poster

Re: date time issue in JSP

  #5  
Jul 6th, 2005
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
Reply With Quote  
Join Date: Jun 2005
Location: india
Posts: 44
Reputation: cheenu78 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
cheenu78's Avatar
cheenu78 cheenu78 is offline Offline
Light Poster

Re: date time issue in JSP

  #6  
Jul 7th, 2005
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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JSP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 5:17 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC