I just found that I had a wrong definition in my function. The following works:
' Return the datetime in French format ' expD1 DatetimePublicSharedFunction GetDateTime(ByVal ttDateTime AsDateTime) AsStringReturn Format(ttDateTime, "dd/MM/yyyy HH:mm:ss")
EndFunction