cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 is decreasing date

naotoxxx
Participant
0 Kudos

Hello community, i'm very disturbed becasue i think that sapui5 is decreasing a date that i pass from my odata, take a look of this:

this is my odata results:

i just print de propertie "Fecha" and i use a sapui5 type:

<Text text="{
				path: '/date',
				type: 'sap.ui.model.type.Date',
				formatOptions: {
					style: 'short'
				}
			}" />

and i'm getting this.

even if do not use anything this is the result: Tue May 24 2016 20:00:00 GMT-0400 (Hora est. Sudamérica Pacífico)

all my dates are the same it should 25/05/16 insted 24/5/16

Accepted Solutions (0)

Answers (2)

Answers (2)

junwu
Active Contributor
0 Kudos

nothing is wrong. the date sent by odata is utc date, you displayed in local timezone in the browser. that's where the difference comes

UxKjaer
Product and Topic Expert
Product and Topic Expert
0 Kudos

That is because it converts your timezone to utc. You need to convert it to system time zone on the way in and out.

You can read more about it here https://blogs.sap.com/2017/06/05/handling-date-and-time-in-post-requests-in-odata/