Task

Given the date string "March 7 2009 7:30pm EST", 

output the time 12 hours later in any human-readable format.

As extra credit, display the resulting time in a time zone different from your own.




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))