Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_java thread: I need some help ...


Message #1 by Guerrino Di Minno <GDiMinno@h...> on Wed, 10 Oct 2001 14:09:44 -0400
> HI to all...
> 
> > I tring to create a class that will let the user enter a date and it 
will
> > display it in two different format.Or just display the date... 
> > Example: ( yy / mm / dd ) and ( yy . mm . dd ).
> > 
> > Can you PLEASE help me....
> > 
> > Thanking you in advance...
> > 
> > Gino
> > 

import java.util.*;
import java.text.*;

public class DateDemo
{
   public static void main(String[] args)
   {
     SimpleDateFormat sdf = new SimpleDateFormat("yy/MM/dd");
     Date d = new Date();
     System.out.println(sdf.format(d));

     sdf = new SimpleDateFormat("yy.MM.dd");
     System.out.println(sdf.format(d));
     
   }
}

  Return to Index