Monday 2 July 2018

Java.util.Date Introduction | Java Date and Time | Date and Time in java


Click here to watch on Youtube:
https://www.youtube.com/watch?v=2fr_Wycgc6s&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge:

Java.util.Date Introduction | Java Date and Time | Date and Time in java

DateDemo1.java

import java.util.Date;

public class DateDemo1
{
    public static void main(String[] args)
    {
        Date date = new Date();
        System.out.println(date);
    }

}

Output

Fri May 11 10:13:43 IST 2018

DateDemo2.java

import java.util.Date;

public class DateDemo2
{
    public static void main(String[] args)
    {
        /*
         * Returns the current time in milliseconds.
         */

        long millis = System.currentTimeMillis();
        Date date = new Date(millis);
        System.out.println(date);
    }

}

Output

Fri May 11 10:13:51 IST 2018

Refer: 
https://docs.oracle.com/javase/8/docs/api/index.html?java/util/Date.html

Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/DateDemo_util_date_intro.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/DateDemo_util_date_intro

Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/bb275a728500f81507bdd46f6424332d29623c06/BasicJava_2018/DateDemo_util_date_intro/?at=master

See also:

  • All JavaEE Videos Playlist
  • All JavaEE Videos
  • All JAVA EE Links
  • Spring Tutorial
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • Cooking Tutorial
  • No comments:

    Post a Comment