A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

Write a program to Get current date and time

import java.util.*;
import java.text.*;

public class ProgrammingShift {

    public static void main(String[] args) {
        //Get current date time
        Date currentDate = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");

Sample output: