Get Date Now Groovy

[Solved] Get Date Now Groovy | Groovy - Code Explorer | yomemimo.com
Question : get date now groovy

Answered by : andry

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)

Source : | Last Update : Thu, 18 Mar 21

Answers related to get date now groovy

Code Explorer Popular Question For Groovy