what has to be referenced so that the format$ function works fine.

i ahve a code which uses format$ function and when run errrors out saying cannot find library

code

here is the how it is being called

x=format$(variable,"mm/dd/yyyy hh:mm AMPM")