Skip to Content
0

SAPUI5 is decreasing date

Mar 13 at 07:37 PM

35

avatar image

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

dec.png (10.0 kB)
e3.png (947 B)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jakob Marius Kjær Mar 13 at 10:45 PM
0

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/

Share
10 |10000 characters needed characters left characters exceeded
Jun Wu Mar 14 at 03:31 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded