You need to sign in to do that
Don't have an account?
Manish.Singh
string to Datetime convertion
Hi Everyone,
I have used following code to convert datetime string to datetime but it not shows correct value. Please help me solve this.
string currentDateString=Datetime.Now().format('YYYY-MM-dd HH:mm:ss','Asia/Kolkata');
system.debug('currentDateString '+currentDateString);
datetime targetDate = Datetime.valueof(currentDateString);
system.debug('targetDate '+targetDate);
My expectation both value will be same.
Please help.
Thank you
I have used following code to convert datetime string to datetime but it not shows correct value. Please help me solve this.
string currentDateString=Datetime.Now().format('YYYY-MM-dd HH:mm:ss','Asia/Kolkata');
system.debug('currentDateString '+currentDateString);
datetime targetDate = Datetime.valueof(currentDateString);
system.debug('targetDate '+targetDate);
My expectation both value will be same.
Please help.
Thank you
Please use the below code.
If this solution helps, Please mark it as best answer.
Thanks,