Java SQL Date convert to Month

Description

Java SQL Date convert to Month

import java.sql.Date;

import java.time.LocalDate;

import java.time.Month;

public class Main {
  
    public static Month getMonth(java.sql.Date date) {
        LocalDate localDate = date.toLocalDate();

        return localDate.getMonth();
    }/*from www.  j  a  v  a 2  s. c o  m*/
}



PreviousNext

Related