In my Oracle DB date is stored in Central Time. My local machine is also in Central time. I am trying to write a Java code so that DB central time can be converted to any local machine time zone. For example if I change my local machine time in Eastern time time from DB will be converted to Eastern time.

Here is Java method which takes date from DB and offset minutes from user browser using JavaScript

Java Code:
private String convertDateToLocal(Date createDate, Long offSetMins) {
		DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm a", Locale.US);
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(createDate);
		Long dbTimeInMilliSec = createDate.getTime();
		Long dbTimeOffSet = (long) (calendar.getTimeZone().getOffset(dbTimeInMilliSec));
		Long dbTimeToUTC = dbTimeInMilliSec + (dbTimeOffSet * -1);
		Long dbTimeToLocal = dbTimeToUTC - (offSetMins * 60 * 1000);
		Date createDateInLocal = new Date(dbTimeToLocal);
		return formatter.format(createDateInLocal);		
	}
Just for reference this is how I am getting offset minutes using JavaScript

Java Code:
var offSetMins= new Date().getTimezoneOffset();
But the issue is even when I have local machine setup to Central time I am seeing time 1hr ahead for days where there is no daylight saving.

DB date (`11/26/2014 12:03 PM`) is showing as (`11/26/2014 01:03 PM`) in UI.

Dates in daylight saving time is OK.

DB date (`05/20/2015 05:08 PM`) is showing as (`05/20/2015 05:08 PM`) in UI.