Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

date time format typescript

import { DatePipe } from '@angular/common'
...
constructor(public datepipe: DatePipe){}
...
myFunction() {
 this.date=new Date();
 const start = this.datepipe.transform(this.date, 'yyyyMMdd'T'HHmmss.SSSZ');
}
....
in app.module.com
import { DatePipe } from '@angular/common'
...
providers: [DatePipe]
 
PREVIOUS NEXT
Tagged: #date #time #format #typescript
ADD COMMENT
Topic
Name
8+5 =