You can’t use Date (or DateTime) in IDE Scripts or XojoScript because they only support the intrinsic types by default. Anything that is an object simply does not exist.
You can usually deal with this with a call to DoShellCommand to get the date from a command line call.
On Windows, use
date /t