View Full Version : Need help in converting system time by using timeZoneOffset

14 May 2013, 5:04 AM
I want to display time and date depend on user, for that i need to convert local time to profile based time by timeZoneOffset, which i will get from server.

here the code i am using to get local time.

var now = new Date();
var currentDate = new Date();
var time = currentDate.getTime();
var sysdate = Ext.Date.format(currentDate,'M d, Y h:i A T');
var today = sysdate;
var timezone = today;

how do i apply timeZoneOffset from server to convert time.

15 May 2013, 5:04 PM
So you want to add (or subtract) hours to the date? You can use Ext.Date.add for this.