Java Date UTC MethodThe UTC method of Java Date class determines the date and time. These are determined by arguments which are interpreted as a year, month, day of the month, an hour of the day. This method is deprecated as of JDK version 1.1 it is replaced by Calendar.set(year + 1900, month, date, hrs, min, sec) or GregorianCalendar(year + 1900, month, date, hrs, min, sec), using a UTC TimeZone, followed by Calendar.getTime().getTime(). Syntax:Parametersyear - the year minus 1900 month - the month between 0-11 date - the day of the month between 1-31 hrs - the hours between 0-23 min - the minutes between 0-59 sec - the seconds between 0-59 ReturnThe UTC method returns the total number of milliseconds since January 1, 1970, 00:00:00 GMT for the date and time as given by the arguments. ExampleTest it NowOutput: Current date to string : Tue Oct 02 18:39:01 IST 2018 Next TopicJava Util Date |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India