Hello Everyone. I am attempting to create a JSP application and having problems with formatting a time field.
I have a time stored in my database (SQL Server) as a Date/Time field and when I query the field I get somthing like:
1900-01-01 06:00:00.000
Below is how I'm getting the time value. I'm placing the time into a String, but I'm not even sure if this is correct.
String ArrivalTime = rsVisitor.getString("visitarrivaltime");
My problem is that when I output this value onto my web page it looks like:
1900-01-01 06:00:00.000
and it should look like:
06:00
I would normally just parse the string and extract the piece that I want to display, except that not all of our times in the database are stored this way. Some are stored in the shorter version. I know in ASP there is a way to format time. Can someone give me the same in JSP? I don't even need the time in a String necessarily, as long as I can print it out.
Thanks to anyone who can help me out!
I have a time stored in my database (SQL Server) as a Date/Time field and when I query the field I get somthing like:
1900-01-01 06:00:00.000
Below is how I'm getting the time value. I'm placing the time into a String, but I'm not even sure if this is correct.
String ArrivalTime = rsVisitor.getString("visitarrivaltime");
My problem is that when I output this value onto my web page it looks like:
1900-01-01 06:00:00.000
and it should look like:
06:00
I would normally just parse the string and extract the piece that I want to display, except that not all of our times in the database are stored this way. Some are stored in the shorter version. I know in ASP there is a way to format time. Can someone give me the same in JSP? I don't even need the time in a String necessarily, as long as I can print it out.
Thanks to anyone who can help me out!