在Groovy中,有一些捷径用于查找Date对象的各种常用变量,如下面列出的那些。如何从groovy中的日期中提取一年的日期
Date now = new Date()
Integer year = now.year + 1900
Integer month = now.month + 1
Integer day = now.date
Integer hour = now.hours
Integer minute = now.minutes
获得今年的一天的快捷方式是什么?
+1问一个问题,并回来回答它! – WilliamShatner
你也可以使用calendar.instance:'Calendar.instance [Calendar.DAY_OF_YEAR]' – bitsnaps