ksky #7568(2008/09/05 01:47 GMT) [ Groovy ] Rating0/0=0.00
初めて投稿します。よろしくお願いします。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)
Rating0/0=0.00-0+
[ reply ]
ksky #7568() [ Groovy ] Rating0/0=0.00
初めて投稿します。よろしくお願いします。new Date(String s)を使えばもっと短く書けると思うけど、deprecatedだから反則ですよね...
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)Rating0/0=0.00-0+
[ reply ]