I'm trying to time stamp my errorLog.txt
In the scripting guide there is this example for alerting the current system time:
var timeSrt = system.callSystem("cmd.exe /c \"time/t\"");
alert("Current time is " + timeStr);
How can I accomplish this on the Mac/osx?
In terminal, the command is "date" but I cant' find the method for executing a command in Terminal.
Thanks!
-C
Date on the mac
Moderator: Paul Tuersley
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
How about using the javascript date object? Just google "javascript date" for reference.
Code: Select all
theDate = new Date();
alert(theDate);
hours = theDate.getHours();
alert(hours);