Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Unable to set datetime format for third party datetime picker


          In our sap ui5 application we used third party date time picker plugin in one pop-up  for insert update operations. Client told us to do not use the sap.m date time picker so we don't have any other choice that's why we have chosen one third party date time picker plugin .While inserting the date it was working fine but while retrieving the date time value from service to pop-up for update functionality the format has been changed completely.So i want to set the format for that date time picker i have tried the below code but does not worked fine will any one please give some suggestion....

var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({pattern: "MM/d/y H:mm:ss A"});

var formattedStartDate = oDateFormat.format((startDate));


Thanks in Advance for your help.



Former Member
Former Member replied

Hi Selva,

For setting the Date to the UI, make sure your entity is having the date field in Edm.DateTime type and your model is having date field in PT format, for eg. PT14H01M00S.

For more clarity, pls see this link

Also let us know if you are getting any error in your browser console while setting the date to UI control.



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question