Answers for "typescript date to formatted string"

3

typescript convert date to string format dd/mm/yyyy

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
1

date format in typescript

#Installation
$ npm install dateformat

#Usage
var dateFormat = require("dateformat");
var now = new Date();
var today = dateFormat(now, "yyyy-mm-dd");
Posted by: Guest on May-03-2021

Browse Popular Code Answers by Language