Sunday, 17 July 2016

java - Date formatting in groovy

package com.javacodegeeks.groovy.date
class GroovyDateArithmetic {
static main(args) {
def date = new Date().parse("dd.MM.yyy", '18.05.1988')
def datePlus = date.clone()
def dateMinus = date.clone()
datePlus = datePlus + 5
println datePlus


The above code will print Mon May 23 00:00:00 EST 1988. How can I format the final result to produce Mon May 23 1988.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...