Probably it is a User defined Function (UDF)
Press F5 and type datefmt in the Reference box. If it is a UDF it will take
you to the VB Editor and show the code (if it is not protected in some way)
If you're lucky, it has some documentation in the code or the code is
somewhat self-explanatory. Otherwise post it here, if it's not too big