cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Date formatting issue

Former Member
0 Kudos
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

Accepted Solutions (1)

Accepted Solutions (1)

Mantovas
Participant

Hi Thijs,

Your issue might be related to the way the gateway format the date.

This is how I format my date for example:

oDateFormat = sap.ui.core.format.DateFormat.getDateInstance({pattern : "yyyy-MM-dd", "UTC": true});

SAP Note 2511532 may help.

Cheers,

Ric.


Answers (0)