Following piece of code is throwing an error: System.TypeException: Invalid date/time: 04/07/2016 02:00 PM
if (t.activitydate != null)
{
DateTime activityDate = t.activitydate;
activityDate = activityDate.addHours(13);
TimeZone tz = UserInfo.getTimeZone();
String dt = activityDate.format('MM/dd/yyyy hh:mm a',tz.getId());
myObj.Date_Time__c = DateTime.parse(dt); //this is a Date/Time object
}
This error happens only for users from Europe but not for users in North America. Could someone please help me point out what is the issue and fix?