Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8524

Re: Handle timezone differences between front-end and backend

$
0
0

Hi Jayant,

 

This behaviour is because of the the time zone differences and also the way date is passed from UI to gateway. If you pass only the date to Odata service from UI, it appends the time as 00:00:00 for hour, minutes and seconds respectively before passing on the date to gateway system.

 

If you want to save only the date selected by the end user, irrespective of the time zone the user is in, just set the UTCDate property of the date object, with the selected date. This compansates the timezone difference and passes the date selected in UI.

 

//oDocumentDateTP is the id of Date picker field

var selDocDate = new Date(sap.ui.getCore().byId("oDocumentDateTP").getValue());

selDocDate.setUTCDate(selDocDate.getDate()); 

 

Thanks & Regards,

Vishwa


Viewing all articles
Browse latest Browse all 8524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>