Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!

Sean Ayles

Greenhorn
+ Follow
since Mar 13, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sean Ayles

Great thanks.
18 years ago
I'm new to Java and trying to format dates both current date and dates since jan 1 1970. I have looked at the api documentation and it isn't very clear how I use the Date class.
I'm trying to get seconds, minutes, days, etc since jan 1, 1970. And I also need to get the current date in the format mm/dd/yyyy-hh:mm:ss.
Any help would be appreciated, thanks.
By the way I am able to use
System.out.println("date: " + new Date());
//Sun Mar 17 19:47:20 PST 2002
but I get an error when I try and store this into a variable of type String.
18 years ago