At present, your function doesn't have a return type. Give it one, so that it
returns, e.g., a date.
Once you've done this, then the standard formatting for the cell should work.
Alternatively, return it as a string (again, give the function a return type to
ensure this happens and also to make it clear what you are doing), with the
formatting already done inside the function.