3 Replies Latest reply on Mar 5, 2012 1:39 PM by j_forrester

    creating a slice of "getFullYear()"

    j_forrester Level 1

      I am trying to get the date with the first 2 digits removed i.e instead of "2012", I am trying to get "12". I have seen examples using slice and substr but cant seem to get them to work i this instance.


      Any help would be much appreciated.


      Below is one of many variations I have tried.




      var currentTime = new Date();

      var year = currentTime.getFullYear();

      year = year.slice(-2);