I have a SQL 2000 database that in one of my columns I record a date and time. The sql format looks like:
10/15/2004 8:00:00 AM
When I retrieve this data to view in a JSP page I get:
Fri Oct 15 00:00:00 EDT 2004
I am not concerned with formatting right now as I have that much figured out but what my issue is I need the actual hh:mm:ss that were entered into the database to display. For some reason my time is reset to midnight regardless of the entry I make.
My current display is without formatting but this is what I will use to just display the time entered:
<% SimpleDateFormat dt = new SimpleDateFormat ("hh:mm:ss a"); %>
This works fine in displaying the time but it always reads 12:00:00 AM regradless of the entry in the database.
Any suggestions on where I could be going wrong in retrieving the time?
Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts.
Introduce Scanner class:
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…