Skip to Content
0
Former Member
Mar 02, 2018 at 01:12 PM

SAPUI5 Date formatting issue

772 Views

dateFormat: sap.ui.core.format.DateFormat.getDateTimeInstance({
		pattern: "yyyyMMdd"
	     })

And later on in the code I format my date like:

// this.datePeriod2 : Mon 31 December 2018 23:59:59 GMT+0100
this.dateFormat.format(this.datePeriod2);

And in the app running on the SAP Gateway it returns:

"20191231"

On my WebIDE it returns:

"20181231"

My question is:

Can someone explain me why in my WebIDE, I do get the right date "20181231" and in the SAP Gateway I get "20191231"? And how do I fix it?

Both UI5 versions are the same: 1.44.8.

I'm really clueless here. Thank you in advance.

Best regards,

Thijs