Trim Datetime to Date only

Version 9.2

I want to have generic function which i can call in email templates to trim the datetime to date only. But I could not achieve this using below script. Please help me to get this function working.

Below is my script. FYI, tried to test  the same with slight modification Example (Options As String-> Options As Date   , $FK(UID_AttestationCase).XDateInserted$->$FK(UID_AttestationCase).XDateInserted:Date$ ......)

Public Function CCC_ConvetDateTimeToDate(baseEntity As IEntity, Options As String) As String

Dim mydatetime as date = Cdate(Options)
Return  Format(mydatetime , "dd-MM-yyyy")
End Function

Below is the syntax in email template. 

$SCRIPT(CCC_ConvetDateTime, "$FK(UID_AttestationCase).XDateInserted$")$

......................
The Same requirement was achieved using below function which works but it is not generic and needs extension if i want to use for any other date column.   

<BaseObjectTypeAttribute("PersonWantsOrg")> _
Public Function CCC_DateHead( ByVal PersonWantsOrg As ISingleDbObject) As String
Dim DateHead As Date= PersonWantsOrg.GetValue("DateHead").Date
Return  Format(DateHead,"dd-MM-yyyy")
End Function