• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how i display date in proper format, which i take from databse timestamp datatype

 
Vinod suryawanshi
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have timestamp datatype for date in mysql table, so when i try to display date on on web site it look like,
"2012-07-18 11:40:44.0"- here extra 0 is coming after "11:40:44" i want to remove that....

so i use sql query,

insted of


and i used

to get values from resultset, so that i can display them on browser.

But when i try to run this .jsp page,
my page was display with half information, like i have 4 textfield, label and one submit button on page.
But only first 2 textfield and labels are getting display. the rest of page is not getting display....

Hope you understand whats my error is, if you have suggestion then please help me,
Thanks in advanced
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly is displayed in your JSP?
 
Vinod suryawanshi
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First Thank you James Boswell for your reply...

When i run program, half of the jsp page is display, suppose, i have three text box with label indicating what value is in text box. When program run i get only 1 text box with there label. Other text box and label are missing from the output
 
R. Jain
Ranch Hand
Posts: 375
1
Java Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vinod suryawanshi wrote:First Thank you James Boswell for your reply...

When i run program, half of the jsp page is display, suppose, i have three text box with label indicating what value is in text box. When program run i get only 1 text box with there label. Other text box and label are missing from the output


But we don't know what you are trying to display in those four textboxes... So we can't figure it out... You have just given one <td> element where you are trying to display date... What about the other three???
 
Vinod suryawanshi
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply R. Jain and James Boswell,

Actually i did mistake, i write sql query as,


and use this code to take data from resultset.


So, my mistake is, i forget to gave column name after DATE_FORMAT(date,'%Y-%m-%d %h:%i:%p'),
When i use sql query,

and use below code to fetch data from resultset,


I am getting values in table like,
2012-08-17 10:53:AM

Once again thanks for showing interest R. Jain and James Boswell..... :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic