Click here to watch in Youtube :
https://www.youtube.com/watch?v=roTe2_lI26A&list=UUhwKlOVR041tngjerWxVccw
SystemDemo.java
https://www.youtube.com/watch?v=roTe2_lI26A&list=UUhwKlOVR041tngjerWxVccw
SystemDemo.java
import java.io.IOException;
import java.util.Date;
public class SystemDemo
{
public static void main(String[] args) throws IOException
{
/*
* Returns the current time in milliseconds.
*/
long currentTimeInms = System.currentTimeMillis();
System.out.println("Current Time in milliseconds = " + currentTimeInms);
Date date = new Date(currentTimeInms);
System.out.println("Current date and Time = "+date);
}
}
OutputCurrent Time in milliseconds = 1488772077364
Current date and Time = Mon Mar 06 09:17:57 IST 2017
Click the below link to download the code:
No comments:
Post a Comment