Java code to get current system Date and Time.


IncludeHelp 20 June 2016

This code snippet will get current system date and time in Java.

Package to be used:
java.util.Date;
Class to get current system date and time:
Date

Java Code Snippet - Get current System Date and Time

import java.util.Date;

public class GetSystemDateTimePrg 
{
    public static void main(String args[])
    {
        Date dt=new Date();
        System.out.print("dt.toString());
    }
}
    

    Mon Jun 20 20:56:09 IST 2016



Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.