Q. how do I obtain the date and time information?
I'd like to know how to get the date and time information and send them to the cgi program.
When I define the variable in javascript, say
var date="02/24/00"
how do I set the "post" envoronment data so that my cgi program access to it? Or should I use "get" method? and how?
I've been asking same question many times and nobody has ever answered me. So somebody please help!
thank you
------------------------------
i am a beginner, and am the one who will be greately appriciated with any type of help.
Re: Q. how do I obtain the date and time information?
java.util.Date d = new java.util.Date(); // get current time
String s = d.toString(); // in displayable format
Does this help?
Re: Q. how do I obtain the date and time information?
java.util.GregorianCalendar C = new java.util.GregorianCalendar();
int mon = C.get(C.MONTH) + 1; //the MONTH field is 0-11
int day = C.get(C.DAY_OF_MONTH);
int year = C.get(C.YEAR);
String s = s.valueOf(mon) + "/" + s.valueOf(day) + "/" + s.valueOf(year);
System.out.println("Date is : " + s);
output is
Date is : 2/23/2000