- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
The following code is supposed to return a two digit year. However I am getting the two digit year with an "in" as a suffix.
var nd = new Date();
var z = nd.getFullYear();
var y = z.toString();
var x = y.substr(2, 3);
app.alert("Variable nd = " + nd + "\n" + "Variable z = " + z + "\n" + "Variable y = " + y + "\n" + "Variable x = " + x);
the alert box upon showing up says:
Variable nd= Tues Nov 06 2012 11:51:11 GMT -0800 (Pacific Standard Time)
Variable z = 2012
Variable y = 2012in
Variable x = 12in
What is going on? "y" should equal 2012 as a string value and "x" 12 as a string value. Where is the "in" suffix coming from? Thanks.
Views
Replies
0 Likes
Total Likes