The date does not contain information about the names of the months or days. To get that you need a formatter: System.out.println(DateTimeFormatter.ofPattern("MMMM").format(hd)); prints Safar....
Selection.NumberFormat = "[$-1170000]B2yyyy/mm/dd;@" ...