Java SQL Date getMinutes() MethodThe getMinutes() method of Java Date class returns the number of minutes past the hour represented by this date. This method should not be used because SQL date values do not have a time component and this method is deprecated too. This method overrides getMinutes in class Date. SyntaxParametersNA ReturnsIt returns the number of minutes past the hour represented by this date. ExceptionIllegalArgumentException is thrown if this method is invoked. ExampleTest it NowOutput: !! this output is shown by using java.util.Date as an alternate to deprecated method java.sql.Date Current time in Minutes = 12 !! this output is shown by using java.sql.Date and proves why this method is deprecated and we can't access time components in java.sql.Date class. Exception in thread "main" java.lang.IllegalArgumentException at java.sql/java.sql.Date.getMinutes(Unknown Source) at tests. JavaSQLDateGetMinutesExample1.main(JavaSQLDateGetMinutesExample1.java:21)
Next TopicJava SQL Date
|