DateTimeStamp

I want to apply a DateTimeStamp to a Field that is formatted the way I want it to be formatted with .toLocaleDateString.

As far as I noticed I have to create a date for that like I did below. But… Notice the differenct in the shown time against showing only getTimeStamp.

Is there something I do wrong. I work with rc5, OS X 10.3 and Dutch locale settings…

var t = new Date(application.getTimeStamp().getYear(),application.getTimeStamp().getMonth(),application.getTimeStamp().getDate(),application.getTimeStamp().getHours(),application.getTimeStamp().getMinutes(),application.getTimeStamp().getSeconds());
note = t;

→ Sun Oct 29 10:57:10 CET 0103

note = application.getTimeStamp();

→ Tue Oct 28 10:57:50 CET 2003

you are getting new (different) timestamps multiple times, which probably causes the difference.

Try this:
var t = new Date() //get’s current datetime
t = t.toLocaleDateString()

FYI:(check the utils node in the method editor)
//format a date to a text representation
utils.dateFormat(orderdate,‘EEE, d MMM yyyy HH:mm:ss’);

Thanks, solved!