public static long convertToUtc ( long millis , String tz ) { long ret = millis ; if ( tz != null && tz . length ( ) > 0 ) { DateTime dt = new DateTime ( millis , DateTimeZone . forID ( tz ) ) ; ret = dt . withZoneRetainFields ( DateTimeZone . forID ( "UTC" ) ) . getMillis ( ) ; } return ret ; }
Returns the given date converted to UTC using the given timezone .