on 06-20-2014 7:12 AM
Hi All,
I am using the Datepicker control for getting the date from the user. (in Singapore timezone).
When i post the date into my oData service i see the date stored 1 day lesser..
var EtTransData = {
__metadata:{
type: "ns.type",
properties: {
Etdate: {
type: "Edm.DateTime"
},
}
},
Etdate: new Date(sap.ui.getCore().byId("Current_Etdate").getValue()),
};
I understand that value comes out in the model is as "Fri Jun 20 2014 00:00:00 GMT+0800 (Malay Peninsula Standard Time)", but when in receive in the service class method create_entity it comes as 19/6/2014.
there is a timezone clash,, but not sure how to fix this ?
please help.
thanks,
Ram
Found the way to fix:
var dateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({pattern : "yyyy-MM-ddTKK:mm:ss" });
var lv_date_val = new Date(sap.ui.getCore().byId("Current_Etdate").getValue());
var dateStr = dateFormat.format(lv_date_val);
var EtTransData = {
__metadata:{
type: "ns.type",
properties: {
Etdate: {
type: "Edm.DateTime"
},
}
},
Etdate: dateStr,
};
Worked well...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.