For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Thursday, August 14, 2014

Time in 24 Hours format in Java

How to show time in 24 Hours format.

Listed below the code; how to show time in 24 format in java

import java.io.*;
import java.util.*;
import java.util.Calendar;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Date;


public class Tm {
    public static void main(String[] args) {
        Date date = new Date();
    SimpleDateFormat simpDate;

    simpDate = new SimpleDateFormat("kk:mm:ss");
    System.out.println(simpDate.format(date));


    }
}
Share:

0 comments:

Post a Comment

Multiple attribute passing in querySelectorAll

Multiple attribute passing in querySelectorAll     Here I am demonstrating code to how to pass multiple attributes in querySelectorAll. <...

Ads Inside Post

Powered by Blogger.

Arsip