I just want to convert String to Time without using "newInstance()" method, it takes four integer type arguments(h,m,s,ms) , but I want this type of format "HH:MM AM/PM". I have a custom field that is "Time" type. and I'm putting value into this, but I'm facing this error. "INVALID date/time 03:15 PM"
Event__c evt = new Event__c();// this is custom object in salesforce org. DateTime dt = System.now(); evt.Start_Time__c = DateTime.parse(dt.format('hh:mm a')).time();
// This is Time field that i want to show on vf page as format('HH:MM AM/PM') , i'm using input type field on the VF page.
When I'm using this type of conversion it's getting an error on the VF page. "INVALID Date/Time 03:15 PM"