You need to sign in to do that
Don't have an account?
Som_11
While inserting the record datetime field value changing to different timezone and inserting but its not getting changed to inserted timezone
Hi All,
Using below method :
public static datetime convertTimeZone(datetime dt, String timezone){
String formatedDtTime = dt.format('yyyy-MM-dd HH:mm:ss',
CDLLoanRequestUtil.TIME_ZONE_MAPPING.get(timezone));
Datetime converteddt = Datetime.valueOf(formatedDtTime);
return converteddt;
}
Datetime newdt = CDLLoanRequestUtil.convertTimeZone(callBackDtTime,'America/Los_Angeles');
Expected to enter with above datetime but after creating record it getting changed. And in debug its comming correct value. Can anyone help with this please.
Using below method :
public static datetime convertTimeZone(datetime dt, String timezone){
String formatedDtTime = dt.format('yyyy-MM-dd HH:mm:ss',
CDLLoanRequestUtil.TIME_ZONE_MAPPING.get(timezone));
Datetime converteddt = Datetime.valueOf(formatedDtTime);
return converteddt;
}
Datetime newdt = CDLLoanRequestUtil.convertTimeZone(callBackDtTime,'America/Los_Angeles');
Expected to enter with above datetime but after creating record it getting changed. And in debug its comming correct value. Can anyone help with this please.