function calculate_time_zone(thdate) {
    if(thdate==undefined)
        thdate = new Date();
    else{
        thdate=thdate.split('-');
        thdate = new Date(thdate[0],(thdate[1]-1),thdate[2]);
    }
    time_offset=-(thdate.getTimezoneOffset()/60);
    var hrs  = thdate.getHours();
    hrs -= time_offset;
    thdate.setHours(hrs);
    
    var time_zone=new Array();

    var year=thdate.getFullYear();
    var month=thdate.getMonth()+1;
        month=month<10?'0'+month:month;
    var date=thdate.getDate()<10?'0'+thdate.getDate():thdate.getDate();
    var hour=thdate.getHours()<10?'0'+thdate.getHours():thdate.getHours();
    var minute=thdate.getMinutes()<10?'0'+thdate.getMinutes():thdate.getMinutes();
    var second='00';

    time_zone['date']=year+'-'+month+'-'+date;
    time_zone['time']=hour+':'+minute+':'+second;
    time_zone['time_offset']=time_offset;
    time_zone['time_current']=time_zone['date']+' '+time_zone['time'];
    return time_zone;
}
