Add tags

Add tags to the following comment

初めて投稿します。よろしくお願いします。new Date(String s)を使えばもっと短く書けると思うけど、deprecatedだから反則ですよね...

1
2
3
4
5
6
7
8
9
format = new java.text.SimpleDateFormat('yyyyMMddHHmmss')

def dateEx(delta, date = null) {
  d = (date) ? format.parse(date) : new Date()
  format.format(new Date(d.time + delta * 1000))
}

println dateEx(40, "20080827235925")
println dateEx(100)

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...