Thread: Time method
View Single Post
  #2 (permalink)  
Old 11-04-2007, 07:49 PM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,124
hardwired is on a distinguished road
Code:
import java.util.*; import java.text.*; public class GettingTheDate { public static void main(String[] args) { DateFormat df = new SimpleDateFormat("dd MMM yyyy"); Calendar calendar = Calendar.getInstance(); Date now = calendar.getTime(); String toStore = df.format(now); System.out.printf("now = %s%ntoStore = %s%n", now, toStore); } }
Reply With Quote