Get current second

Complete source code below, will show you how to get current computer second and print the value. The second value that it get is second value at program executing time.

>>Get current minute
>>Get current hour
>>Get current computer time in java

******************************************************************
COMPLETE SOURCE CODE FOR : GetCurrentSecond.java
******************************************************************


import java.util.Date;

public class GetCurrentSecond
{
public static void main(String[]args)
{
Date myDate=new Date();

//Get current second
int currentSecond=myDate.getSeconds();

//Print current second that we get
System.out.println("Current second is : "+currentSecond);
}
}


******************************************************************
JUST COMPILE AND EXECUTE IT
******************************************************************

RELAXING NATURE VIDEO