Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package helper; /** * * @author Kaled */ import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; public class JodaTimeHelper { public String calculateDateTime() { DateTime dt = new DateTime(); dt = dt.withZone(DateTimeZone.forID("-05:00")); DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"); return fmt.print(dt); } }