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.