Answers for "date pipe mm/dd/yyyy angular"

2

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

angular get current date yyyy-mm-dd

import { DatePipe } from '@angular/common';

@Component({
    templateUrl: './name.component.html',
    styleUrls: ['./name.component.scss'],
    providers: [DatePipe]
})

myDate = new Date();
constructor(private datePipe: DatePipe){
    this.myDate = this.datePipe.transform(this.myDate, 'yyyy-MM-dd');
}
Posted by: Guest on September-13-2020
12

angular date pipe

// In Angular 
// Html
<p>{{myDate | date: 'dd-MM-yyyy'}}</p>
// Typescript
myDate: Date = new Date();
Posted by: Guest on July-13-2020

Code answers related to "date pipe mm/dd/yyyy angular"

Code answers related to "Javascript"

Browse Popular Code Answers by Language