convert date string to date object via sap.ui.core.format.DateFormat

			//convert date string to date object
			var sDate = "2023-12-31";
			var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({ pattern: "yyyy-MM-dd"});
			oDateFormat.parse(sDate);
			//Expected output: Sun Dec 31 2023 00:00:00 GMT+0100
			oDateFormat.parse(sDate, true); //UTC
			//Expected output: Sun Dec 31 2023 01:00:00 GMT+0100

Leave a Reply

Your email address will not be published. Required fields are marked *