Java Current Time and Date Program

Simple Java Current Time and Date Program


This is a Straight Forward Code Example for obtaining the Current Time and Date using Java Programming Language.

Java


import java.util.Date;

public class DateDemo { 
public static void main(String args[]) {

Date date = new Date();  
String str = String.format("Current Date/Time : %tc", date );

System.out.printf(str); } }




Java Fun Fact


IT WAS JUST AN ACCIDENT!

James Gosling was working at Sun Labs, around 1992. Gosling and his team was building a set-top box and started by "cleaning up" C++ and wound up with a new language and runtime. Thus, Java or Oak came into being.


More Free Code Examples:


Angular JS Click Counter








Comments

Popular posts from this blog

Crypto Mining

Multi-tap Keypad Text Entry