time display only as hh:mm.

time display only as hh:mm.

Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?

View Answers

August 28, 2012 at 10:45 AM

Here is a jsp example that fetch the time from the database and display in different format.

<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<%@page import="java.text.*"%>

<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
        Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root" );
        Statement st=conn.createStatement();
        ResultSet rs=st.executeQuery("select * from patient");
        SimpleDateFormat sdf=new SimpleDateFormat("hh:mm");
        while(rs.next()){
        java.sql.Time dbSqlTime = rs.getTime("tob");
        java.util.Date date = new java.util.Date(dbSqlTime.getTime());
        out.println(sdf.format(date)+"<br>");
        %>









Related Tutorials/Questions & Answers:
Only Display Date
Only Display Date  I want to implement only date not time like that 20 Sep 2011. How can possiple it?   Your question is not clear. Which technology you use? java/.NET/SQl
display:table export only data
display:table export only data  I am using display:table tag with attribute export="true". Using that I can export table data in excel. Here one of the column is in hyper link. But i need to export only data not html tag . Can
Advertisements
Time display - JSP-Servlet
Time display   In a web application or ina website if we display the time getting as system time, whether it is server' system time or client' system time. Is there any difference between getting time using java Date
How to display the current time
How to display the current time  I was develop online web portal. In this web portal i am going to display time. I am using <%= new java.util.Date() %> to display the time. But it display the time after that cannot changed
Mysql Time Only
Mysql Time Only       Mysql Time Only is used to return the current time on your current local system... | +---------------------+ 1 row in set (0.00 sec) Query to find time only
Using JFreeChart to display recent changes in a time series
Using JFreeChart to display recent changes in a time series  Using JFreeChart to display recent changes in a time series
PHP Display date and time
PHP displaying the time and date into your timezone       For a lot of people, when they use the date() function in PHP, it doesn't display the correct time and date for their region
Display Date and Time - Design concepts & design patterns
Display Date and Time  HI, Can u send me Html code displaying system date and time . Thanks Prakash  Hi Friend, Try the following code: System Date and Time var date = new Date(); document.write
display current time when using datetimepiker in struts2
display current time when using datetimepiker in struts2  how to display current time when using datetimepiker in struts2 I set displayFormat="dd/MM/yyyy HH:mm:ss" but it doesn't work. Display value is always : 19/11/2010 00:00
Display PHP clock with user input date and time
Display PHP clock with user input date and time  The following PHP code displays a clock with current date and time. I want the clock to receive user input date and time. How can this be done? <?php date<em>
how to display default radio button in struts2.0 for first time login - Struts
how to display default radio button in struts2.0 for first time login  hi, this is suresh jampala, i have one question regarding struts2.0,how can i display default radio button in struts2.0 when ever i loggedin first time
Display current time & system properties using JSP expressions
Display current time & system properties using JSP expressions In this Section ,we will display current time and system properties using JSP...; This JSP expression display current date.   <
Write an Applet which display current date and time on the web page??
Write an Applet which display current date and time on the web page??  Write an Applet which display current date and time on the web page??  Here is an applet code that display date and time. import java.applet.
Write an Applet which display current date and time on the web page??
Write an Applet which display current date and time on the web page??  Write an Applet which display current date and time on the web page?  Here is an applet code that display date and time. import java.applet.
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time display only as hh:mm.  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database
time
time format hh:mm:ss  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database and display
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database and display in different
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database and display in different
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?  **struts.xml** <?xml version... { session.put("dateFormat", "dd/MM/yyyy"); log.error("Date Format
Create a web application using any technology to display 10 most relevant tweets from Twitter in real-time for the keyword
Create a web application using any technology to display 10 most relevant tweets from Twitter in real-time for the keyword   Create a web application using any technology to display 10 most relevant tweets from Twitter in real
Create a web application using java technology to display 10 most relevant tweets from Twitter in real-time for the keyword
Create a web application using java technology to display 10 most relevant tweets from Twitter in real-time for the keyword   Create a web application using java technology to display 10 most relevant tweets from Twitter in real
web application using any technology to display 10 most relevant tweets from Twitter in real-time
web application using any technology to display 10 most relevant tweets from Twitter in real-time  web application using any technology to display 10 most relevant tweets from Twitter in real-time
time
retrieved time from mysql database  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm... is a jsp example that fetch the time from the database and display in different
How Insert DateTime Vales into Mysql Databse from the front end application.But User Gives Date only from Datepicker,not Time
not time only date he/she pick up,then click insert that time ,i want insert that date and time is into Column exist with name "EnterdDate" data type is "DATETIME... User Gives Date only from Datepicker,not Time  I am new developer
How Insert DateTime Vales into Mysql Databse from the front end application.But User Gives Date only from Datepicker,not Time
not time only date he/she pick up,then click insert that time ,i want insert that date and time is into Column exist with name "EnterdDate" data type is "DATETIME... User Gives Date only from Datepicker,not Time  I am new developer
How send different files to browser at same time ..example(pdf&html) want display in same request using servlet
at same time ..example(pdf&html) want display in same request using servlet...How send different files to browser at same time ..example(pdf&html) want display in same request using servlet  package com.readfiles; import
display
display  please tell me how to display the content from database.. if we click on any image using servlets/jsp...please
time
time  sir, i want to show system time on a textfield in awt(java). woulk you send me an example of time which can show time in standard format like H:M:S pls help me sir   Display time in JTextField import
PHP Generate a pages loading time Tutorial
PHP Page Loading Time       In the given example we will learn how to generate and display the amount of time taken to load and display a specific page, for debugging or display
time
time  how to find the current system time between the user login and logout using java
Display current time using jQuery & JSP
Display current time using jQuery & JSP In this Tutorial we will develop a Html page which displays current date and time using jQuery and JSP... to pool the data from server and display on the client side. We have used
display ten items
display ten items  Sir ,in my shopping project when i do search it displays all items according to search criteria from database , i want display only ten items at a time and give next as link to disply remaining items. please
UIView landscape only
UIView landscape only  HI, How to display your view in landscape orientation only? Thanks   Hi, You use the following code in your view controller class: - (BOOL)shouldAutorotateToInterfaceOrientation
Get Date and Time
Get Date and Time       In the example given below we will see, how to display current date and time in the user given format. To do all this we have first
PHP Displaying the date and time in your timezone Tutorial
PHP Date Time Zone       In PHP Date Time Zone class displays the time of different time zone, along with time it is also capable of displaying the longitude, latitude and comment
Digit Only text field
Digit Only text field  How should we accept digits only in a textbox? (using JSTL only, without Javascript
Display message automatically using Java Swing
Display message automatically using Java Swing Here we are going to display message automatically after regular interval of time. For this, we have... Thread.sleep(time)  pauses the execution for the specified number
Works only for one row
Works only for one row   Hi, My below code is working only..." name="updat1" style="display: none" id="updat1" style="border:hidden"/><...="Submit Answer" style="display:none" name="Ans" id="Ans" onClick="invoke(6)"/>
ModuleNotFoundError: No module named 'only'
ModuleNotFoundError: No module named 'only'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'only' How to remove the ModuleNotFoundError: No module named 'only' error
Allowing only localhost in Elasticsearch
Allowing only localhost in Elasticsearch  Hi, I have installed Elasticserch on the production platform. Now I want to enable its access only from localhost. How I can allow Elasticseach from localhost only? Thanks   
bootstrap affix only on desktop
bootstrap affix only on desktop  Hi, I am using bootstrap plugin... get fixed in the mobile/tablet screen also. I want the bootstrap affix only... affix should not work there. So, how I can enable bootstrap affix only
time ()
PHP time() Function The time() returns the current time  measured...;). Syntax of time() Function in PHP time(void) Parameter of time() Function in PHP void - void is optional parameter.  Example of time

Ads