Date Mismatch in UI5 Application

后端 未结 2 1563
伪装坚强ぢ
伪装坚强ぢ 2020-12-12 05:04

I have a DatePicker in UI5 application. My server is in Australia. When I create any record in IST time, it is working fine. But when a user tries to create any record in Au

2条回答
  •  星月不相逢
    2020-12-12 05:47

       prepareDatesToDisplay: function(oDate){ //to display dates from backend
                    var oTempDate = new Date(oDate);
                    oDate = new Date(oTempDate.getTime() + oTempDate.getTimezoneOffset() * (60000));
                    return oDate;
        },
        changeDateToUTC: function(oDate){ //for sending dates to backend
                    var oTempDate = new Date(oDate.setHours("00","00","00","00"));
                    oDate = new Date(oTempDate.getTime() + oTempDate.getTimezoneOffset() * (-60000));
                    return oDate;
        },
    

提交回复
热议问题