aspose file tools*
The moose likes Struts and the fly likes how i display date in proper format, which i take from databse timestamp datatype Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how i display date in proper format, which i take from databse timestamp datatype" Watch "how i display date in proper format, which i take from databse timestamp datatype" New topic
Author

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

Vinod suryawanshi
Ranch Hand

Joined: Aug 08, 2012
Posts: 51
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

Joined: Nov 09, 2011
Posts: 1030
    
    5

What exactly is displayed in your JSP?
Vinod suryawanshi
Ranch Hand

Joined: Aug 08, 2012
Posts: 51
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

Joined: Aug 11, 2012
Posts: 375
    
    1

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

Joined: Aug 08, 2012
Posts: 51
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..... :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how i display date in proper format, which i take from databse timestamp datatype