Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

ts change date format

import { DatePipe } from '@angular/common'
...
constructor(public datepipe: DatePipe){}
...
myFunction(){
 this.date=new Date();
 let latest_date =this.datepipe.transform(this.date, 'yyyy-MM-dd');
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ts #change #date #format
ADD COMMENT
Topic
Name
5+2 =