Create a Date object representing the current date and time. Print it out.
If you can also do this without creating a Date object you can show that too.
java import java.util.Date;
public class SolutionXX {
public static void main(String[] args) {
Date now = new Date();
System.out.println(now.toString());
}
}
import java.util.Date;
public class SolutionXX {
public static void main(String[] args) {
Date now = new Date();
System.out.println(now.toString());
}
}
Submit a new solution for
java
There are 18 other solutions in
additional languages (
clojure,
cpp,
csharp,
erlang ...)