I have a requirement to convert string value to DateTime without converting it to time zone. Ex:
Datetime today = Datetime.now();
String myDate = today.format('yyyy-MM-dd HH:mm:ss');
Datetime myDateTime = Datetime.valueOf(myDate);
System.debug('myDate:: '+myDate );
System.debug('myDateTime:: '+myDateTime);
in the above example, if myDate is 2019-09-15 23:03:23 then myDateTime is appearing as 2019-09-15 17:33:23 by converting to different time zone.
I want to get same value for both myDate and myDateTime.
Is there any way to do that?