Answers for "date +"%Y" groovy"

1

get date now groovy

import java.text.SimpleDateFormat 
import java.util.Date

Date now = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(now);

int yearNow = calendar.get(Calendar.YEAR)
int monthNow = calendar.get(Calendar.MONTH)
int dayNow = calendar.get(Calendar.DAY_OF_MONTH)
Posted by: Guest on March-11-2021
0

groovy date + 1 day

Date date = new Date().plus(1)
Posted by: Guest on October-06-2020

Browse Popular Code Answers by Language