Covert / Formatting Timestamp to Date Format :: JSP : Tech Guru India Covert / Formatting Timestamp to Date Format :: JSP :: Tech Guru India

Covert / Formatting Timestamp to Date Format :: JSP




Suppose "ts" is the timestamp filed in database.

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

<%

    String connectionURL = "jdbc:mysql://localhost/essar?user=root;password=12345";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;

    Class.forName("com.mysql.jdbc.Driver");
    connection = DriverManager.getConnection(connectionURL,"root","");
    statement = connection.createStatement();

%>



rs = statement.executeQuery("select * from timetable");

while(rs.next())
{
SimpleDateFormat dateFormat = new SimpleDateFormat(" dd-MM-yyyy ");
Timestamp t1 = rs.getTimestamp("ts");
String t = dateFormat.format(t1);
}



resent related search::
jsp timestamp
asp timestamp
jsp getdate
jsp datetime
vb timestamp
getdate timestamp
c# timestamp
timestamp formats
using timestamp
calculate timestamp
insert timestamp
jsp dateformat
vb.net timestamp
timestamp seconds
mssql timestamp
jsp sql
jsp functions
ms sql timestamp
jsp int
jsp integer
perl timestamp
jsp query
jdbc timestamp
jsp function
jsp ms sql
jsp db2
jsp mssql
jsp blob
jsp perl
jsp jdbc
jsp string
 


We will send you more information, Enter your email address:


Related Posts with Thumbnails

Share/Save/Bookmark

0 comments:

Post a Comment