Answers for "use calendar in java"

1

calendar.year java

import java.time.LocalDate;  
import java.time.Year;  
public class YearExample{  
  public static void main(String[] args) {  
    Year y = Year.of(2017);  
    LocalDate l = y.atDay(123);  
    System.out.println(l);  
  }  
}
Posted by: Guest on September-03-2021
1

java calendar class format

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Date date = new Date();
System.out.println(dateFormat.format(date)); //2013/10/15 16:16:39
Posted by: Guest on September-24-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language