Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get only last 2 digit of year in javascript

var strDate = new Date(); // By default Date empty constructor give you Date.now
var shortYear = strDate.getFullYear(); 
// Add this line
var twoDigitYear = shortYear.toString().substr(-2);
Comment

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);
 }
Comment

PREVIOUS NEXT
Code Example
Javascript :: toggle text jquery 
Javascript :: test if jquery works 
Javascript :: refresh window js 
Javascript :: jquery link 
Javascript :: kill all node processes 
Javascript :: react native rename 
Javascript :: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jquery 
Javascript :: jquery clear file input 
Javascript :: changing columns for table requires doctrine dbal install doctrine/dbal 
Javascript :: javascript get random array value 
Javascript :: React version on CMD 
Javascript :: javascript function generate a random string 
Javascript :: random number between 0 and 3 
Javascript :: tolowercase jquery 
Javascript :: install expo cli mac os 
Javascript :: jquery phone number mask 
Javascript :: react place div at center of page 
Javascript :: js get element window offset top 
Javascript :: loop through object jquery 
Javascript :: self executing async function in js 
Javascript :: counterup2 cdn 
Javascript :: how to use datepipe in ts file 
Javascript :: check if localstorage key exists 
Javascript :: javascript random number between 1 and 10 
Javascript :: number with commas js 
Javascript :: js replace space 
Javascript :: express post body undefined 
Javascript :: npx create-react-app 
Javascript :: read directory in node js 
Javascript :: jquery disable class attribute 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =