Java Date getDay() Method22 Mar 2025 | 1 min read The getDay() method of java date class returns the value between 0 to 6 which represents the day of the week by this date object.
This method is deprecated as of JDK version 1.1 and replaced by Calender.get(Calender.DAY_OF_WEEK) Syntax:ParametersNA ReturnIt returns the day of the week represented by this date object. Example 1Output: day of the week is : 3 Next TopicJava Util Date |
Java Date Method The method of Java Date class converts this date object into a String in form "dow mon dd hh:mm:ss zzz yyy". This method overrides toString in class object. Syntax: public String Parameters NA Return It returns a String representing this date object. Example 1 import java.util.Date; public class JavaDateToStringExample1...
1 min read
Java Date Method The method of Java date class tries to interpret the string 's' as date and time representation. If this attempt is successful then it will return number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this string argument. This method...
1 min read
Java Date Method The method of Java Date class returns the value between 0 to 61 which represents the second of the past minute and second of the minute is represented by this date object. This method is deprecated as of JDK version 1.1 and...
1 min read
Java Date Method The method of Java Date class returns a value which is a hash code for this object. This method overrides hashCode in class Object. Syntax: public int Parameters NA Return It returns a hashCode value for this object. Example 1 import java.util.Date; public class JavaDateHashCodeExample1 { public static void main(String[]...
1 min read
Java Date Method The method of Java Date class converts this date object into an Instant, and it returns an instant representing the same point on the tim-line as the date object. Syntax: public Instant Parameters NA Return It returns an instant representing the same point on time-line as...
1 min read
Java Date Method The method of Java Date class returns the value between 0 to 23 which represents the hour within the day by this date object. This method is deprecated as of JDK version 1.1 and replaced by Calender.get(Calender.HOUR_OF_DAY) Syntax: @Deprecated public int Parameters NA Return It returns the...
1 min read
Java Date Method The method of Java Date class returns a Boolean value on the basis of compression between two dates for equality. This method overrides equals in class Object Syntax: public boolean equals(Object obj) Parameters obj - an object to be compared Return It returns true if the objects...
1 min read
Java Date Method The method of Java Date class returns a copy/clone of this object. This method overrides clone in class Object. Syntax: public object Parameters NA Return It returns a clone/copy of this instance. Example 1 import java.util.Date; public class JavaDateCloneExample1 { public static void main(String[] args) { Date d=new Date(2018,9,21); System.out.println("Clone of your...
1 min read
Java Date Method The method of Java Date class returns the value between 1 to 31 which represents the day of the month by this date object. This method is deprecated as of JDK version 1.1 and replaced by Calender.get(Calender.DAY_OF_MONTH) Syntax: @Deprecated public int Parameters NA Return It returns the...
1 min read
Java Date Method The method of Java Date class tests whether the date is after the specified date or not. Syntax: public boolean after(Date when) Parameters when - a date Return It returns a Boolean value true if this date is after the specified date. Otherwise, returns false. Exception NullPointerException will be...
1 min read
We request you to subscribe our newsletter for upcoming updates.
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