Probably the value of the environment variable %PATH% is different. This is a common problem when running scripts from schedulers.
In any case you don't need to call an external program to get the date, perl provides the localtimebuiltin that returns the required information to build that date string yourself.