Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get last two digits of year javascript

 maskDate(date) {
    // console.log(date);
    var dateVar = new Date(date);
    // console.log("XX/XX/"+ dateVar.getFullYear().toString().substr(-2));
    return "XX/XX/"+ dateVar.getFullYear().toString().substr(-2);
 }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #digits #year #javascript
ADD COMMENT
Topic
Name
5+6 =