You need to sign in to do that
Don't have an account?

Time format representation format
Hi,
I want to represent the time in hh:mm format , i am using the following code below,
if(callReppaMap.get(ac.personContactId)!=null){
DateTime dt=System.now();
String dtStr=dt.format('HH:mm');
paDet.crdate=String.valueof(callReppaMap.get(ac.pe
rsonContactId).Date__c);
}else{
paDet.crdate='';
}
but i am getting the date as well as time, please help me with my issue.
Thanks in Advance
Hi!!
If so use this, it might work.
if(callReppaMap.get(ac.personContactId)!=null){
paDet.crdate=String.valueof(callReppaMap.get(ac.personContactId).Date__c.format('hh:mm a'));
}else{
paDet.crdate='';
}
With Regards,
Manjunath
All Answers
Hi!!
Is Date__c is your datetime field.
Thanks
Manjunath
Yes, correct , Date__c is a date/time field
Hi!!
If so use this, it might work.
if(callReppaMap.get(ac.personContactId)!=null){
paDet.crdate=String.valueof(callReppaMap.get(ac.personContactId).Date__c.format('hh:mm a'));
}else{
paDet.crdate='';
}
With Regards,
Manjunath
Thanks a lot dude,It worked.