how to convert perl script into exe file?
Hello Sir, I am working on jsp , fetching the datetime(08/21/2006 10:00:00PM) datatype value from MS SQL server database and need to displaying it in the following format Monday 16th, 2006 10:00:00PM in my webpage Anybody knows how to do this format? regards
sorry the title is the above one
Using the class SimpleDateFormat, I'd guess.
Do you have the sample code to do this format eactly what i mentioned ?
No, Read the [url=http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html]API for SimpleDateFormat[/url] and understand it. Then apply that knowledge. There are even examples and you should really learn to read documentation, otherwise you'll allways depend on others to do your work ...
Boss,
i tried my level best.
See the problem is , while fetch the datetime data from MS sqlserver and display into jsp as like 2006-08-16 10:11:23.0
i am using result.getString(colno) to get the datetime value. but it returns the above, i wanted to convert and display as Wed Aug 16, 2006 10:45:32AM
i failed even after tried the SimpleDateFormat.
plz help me
Get your field value from gthe result set into the appropriate type instead of String... then try the solution suggested above.
I'm not your boss or even a boss.Don't use result.getString(colno), but rather result.getDate(colno). This way you'll have an object of type Date in your hands. Then try again with the SimpleDateFormat.
Excellent! Your suggestion worked out! You are my boss, since you only given me the solution.Thanks
it would be so great if our code is able to display the time as well. but it doesn't not display the time !!!!
here is the code what i tried:
java.text.SimpleDateFormat fmt =
new java.text.SimpleDateFormat("EEE, MMM d, ''yy");
<TD> <%= fmt.format(resultset.getDate(4)) %> </TD>
output:
Wed, Aug 16, '06
[url=www.brucespringsteen.net/]The Boss[/url][url= http://www.imdb.com/gallery/mptv/1243/Mptv/1243/4599_0013.jpg?path=pgallery&path_key=Booke,%20Sorrell]The Boss[/url]
Obviously, because you didn't tell it to display the time ... read the API for SimpleDateFormat again and check wether there is any way to include the time ...
when i tried to modify the above code as java.text.SimpleDateFormat fmt =new java.text.SimpleDateFormat("EEE, MMM d, yyyy hh:mm:ss");it always displays the date correctly Wed, Aug 16, 2006 12:00:00 but time always 12:00:00 !!!!!!!
Oops ... I've forgotten that JDBC has it's own idea of the Date datatype. You should have used getTimestamp() instead of getDate().
wow.. you are amazing! I am much obliged to You !! Regardsvenki
Have you read the JavaDoc ? I found it pretty clear about the time patterns...