Posted By

snipleritesteri on 09/29/09


Tagged

java SimpleDateFormat


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

beckje01


Java - SimpleDateFormat


 / Published in: Java
 

  1. import java.text.SimpleDateFormat;
  2.  
  3. import java.util.Date;
  4.  
  5. public class JavaSimpleDateFormatExample{
  6.  
  7. public static void main(String args[]){
  8.  
  9. Date date = new Date();
  10.  
  11. String DATE_FORMAT = "MM/dd/yyyy";
  12.  
  13. SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
  14.  
  15. System.out.println("Today is " + sdf.format(date) );
  16.  
  17. }
  18.  
  19. }

Report this snippet  

You need to login to post a comment.