Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Date-manipulation/Groovy/date-manipulation.groovy
Normal file
12
Task/Date-manipulation/Groovy/date-manipulation.groovy
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import org.joda.time.*
|
||||
import java.text.*
|
||||
|
||||
def dateString = 'March 7 2009 7:30pm EST'
|
||||
|
||||
def sdf = new SimpleDateFormat('MMMM d yyyy h:mma zzz')
|
||||
|
||||
DateTime dt = new DateTime(sdf.parse(dateString))
|
||||
|
||||
println (dt)
|
||||
println (dt.plusHours(12))
|
||||
println (dt.plusHours(12).withZone(DateTimeZone.UTC))
|
||||
Loading…
Add table
Add a link
Reference in a new issue