answersLogoWhite

0

Here is a simple program to get the current date and time: import java.util.Date;

import java.text.SimpleDateFormat; public class PrintDate {

public static void main(String[] args) {

Date now = new Date();

SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss Z");

System.out.println(sdf.format(now));

}

}

User Avatar

Wiki User

16y ago

What else can I help you with?