View Single Post
  #1 (permalink)  
Old 11-03-2007, 07:08 PM
java_fun2007 java_fun2007 is offline
Member
 
Join Date: Nov 2007
Posts: 35
java_fun2007 is on a distinguished road
Time and Date in Java
hello,

I want to ask the user to enter a date and time that he want. I don't know how to do that??

I just know how to set any value I want of a date or time, but you know I can't do the same when asking the user to enter.
how can I ask the user to enter any value he wants? please give me a coding example I don't understand java well.
I'm a newbie the only thing I know about time and date is this:

Thanks
Quote:
import java.util.*;
import java.sql.Time;
class Datess
{

public static void main(String s[])
{
Date d=new Date();
System.out.println(d) ;

Calendar c=new GregorianCalendar(1985,9,15);
Date d1=c.getTime();
System.out.println(d1) ;
c.set(2007,9,1);
Date d2=c.getTime();
System.out.println(d2) ;

Time t=new Time(12,50,0);
System.out.println(t) ;}
Reply With Quote
Sponsored Links