10:43 am - Thursday January 19, 2017

Calendar in java example program setTimeInMillis(long millis)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

/**
@author:candidjava.com
@description:Calendar in java example program setTimeInMillis(long millis)
*/
import java.util.Calendar;
public class SetTime {
public static void main(String args[]) {
Calendar c = Calendar.getInstance();
System.out.println(c.getTime());
c.setTimeInMillis(6000);
System.out.println("after setting the time in miils:" + c.getTime());
}
}

//output
Tue Dec 1812:02:25  IST 2012
after setting the time Thu Jan 01 5:30:06 IST 1970

BACK

Filed in: Z-A All Java Codes

Comments are closed.