Java Calendar ComputeFields() MethodThe computeFields() method of java Calendar class is protected and abstract method. It converts the current millisecond time value to calendar field values in fields[].This allows syncing up with the calendar field values with a new time that is set for the calendar object. SyntaxParameterNA ReturnsThis method does not return any value. ThrowsNA Example 1Output: The current date is : Tue Jul 31 20:06:08 PDT 2018 New date is : Thu Jan 01 00:00:00 PST 3018 New date is : Thu Jan 01 00:00:00 PST 3018 Example 2Output: The current date is : Tue Jul 31 20:14:45 PDT 2018 New date is : Sun Nov 01 00:00:00 PST 1970 New date is : Sun Nov 01 00:00:00 PST 1970 Example 3Output: The current date is : Tue Jul 31 20:19:24 PDT 2018 New date is : Sat Jan 10 00:00:00 PST 1970 New date is : Sat Jan 10 00:00:00 PST 1970 Example 4Output: The current date is : Tue Jul 31 20:21:45 PDT 2018 New date is : Thu Jan 01 23:16:40 PST 1970 New date is : Thu Jan 01 23:16:40 PST 1970 Next TopicJava-calendar-equals-method |
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