Skip to Content

SAPUI5 is decreasing date

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 13 at 10:45 PM

    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/

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14 at 03:31 AM

    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

    Add comment
    10|10000 characters needed characters exceeded