Ok, this should be very simple but I am stuck.
I want to get the Month, Day and Year for the current day.
Here's my script:
var
tDate = Date();
app.alert("tDate is: " + tDate );
// get today's month
var M = tDate.getMonth() + 1; // 0 based
app.alert("M is : "
+ M );
var D = tDate.getDate(); // get today's day
var Y = tDate.getFullYear(); // get today's year
I get the tDate, which is correct, but I can't get the month, day and year. Please help.
Thanks!
Student
Solved! Go to Solution.
Views
Replies
Total Likes
Try this way.
var tDate = new Date();
app.alert("tDate is: " + tDate );
try{
var M = tDate.getMonth()+1; // 0 based - // get today's month
var D = tDate.getDate(); // get today's day
var Y = tDate.getFullYear(); // get today's year
app.alert("M: "+ M +"D:" +D + "Y:" +Y);
}
catch(e){app.alert(e)}
Raghu.
Views
Replies
Total Likes
Try this way.
var tDate = new Date();
app.alert("tDate is: " + tDate );
try{
var M = tDate.getMonth()+1; // 0 based - // get today's month
var D = tDate.getDate(); // get today's day
var Y = tDate.getFullYear(); // get today's year
app.alert("M: "+ M +"D:" +D + "Y:" +Y);
}
catch(e){app.alert(e)}
Raghu.
Views
Replies
Total Likes
Thanks Raghu
That was silly to miss "new" there
Views
Replies
Total Likes