Hi there, welcome to
Java ranch. This question probably belongs in the Beginners Forum (and if you search there you'll find many answers to this question) but regardless of that:
Look at the DateFormat class(es) in particular SimpleDateFormat, you'll quickly see what to use.
Hope that helps!