Click here to watch on Youtube :
https://www.youtube.com/watch?v=BOACIeM4Fvk&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java 8 LocalDateTime Class Introduction | Java 8 Date and Time | Java Date and Time |
import java.time.LocalDateTime;
public class LocalDateTimeDemo
{
public static void main(String[] args)
{
/*
* Returns:
*
* the current date-time using the system clock and
* default time-zone, not null
*/
LocalDateTime localDateTime = LocalDateTime.now();
System.out.println(localDateTime);
}
}
public class LocalDateTimeDemo
{
public static void main(String[] args)
{
/*
* Returns:
*
* the current date-time using the system clock and
* default time-zone, not null
*/
LocalDateTime localDateTime = LocalDateTime.now();
System.out.println(localDateTime);
}
}
Output
2018-01-12T09:32:49.274
Refer:
https://docs.oracle.com/javase/8/docs/api/index.html?java/time/LocalDateTime.html
Click the below link to download the code:
https://sites.google.com/site/ramj2eev1/home/javabasics/LocalDateTimeDemo_Intro.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/LocalDateTimeDemo_Intro
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/3514079d9b379c7f3045963fa5d8a9dc6abeab4b/BasicJava/LocalDateTimeDemo_Intro/?at=master
See also:
No comments:
Post a Comment