Answers for "interpolation date format angular"

2

show timestamp as yyyy mm dd html angular

{{date  | date:'yyyy-MM-dd'}}
Posted by: Guest on February-17-2020
1

show timestamp as yyyy mm dd html angular

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');
}
Posted by: Guest on February-17-2020
0

new date in interpolation angular

// create a method in .ts file
convertDate(date){
  return new Date(date+' UTC');//convert UTC time to Local time
}

//call the above function from .html file
{{convertDate(item.CreatedOn) | date:'medium'}}
Posted by: Guest on June-01-2021

Code answers related to "interpolation date format angular"

Browse Popular Code Answers by Language