TehByte Posted August 29, 2010 Posted August 29, 2010 How do I echo the time/date to a console with Java? I want the format to be [dd-mm-yyyy ss:hh] Quote "I never see what has been done; I only see what remains to be done.." - Buddha | My Profile | Message Me |
GhostSnyper Posted August 30, 2010 Posted August 30, 2010 Umm in java, you'd use the DateTime package... import java.util.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; public abstract class Time { private String getDateTime() { DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); Date date = new Date(); return dateFormat.format(date); } } 1 Quote ~GhostSnyper http://i142.photobucket.com/albums/r116/ghostsnyper/Ilovethat1.jpg
TehByte Posted August 30, 2010 Author Posted August 30, 2010 Ahhh, thank you Dan Quote "I never see what has been done; I only see what remains to be done.." - Buddha | My Profile | Message Me |
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.