The problem is as follows: current time changes constantly, each mome
Actually, you don't need any library for this simple task. If you are doing in your angular project with angular 6+ then import formatDate from the common package and pass other data. Here is a sample:
import { Component } from '@angular/core';
import {formatDate } from '@angular/common';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
today= new Date();
todaysDataTime = '';
constructor() {
this.todaysDataTime = formatDate(this.today, 'dd-MM-yyyy hh:mm:ss a', 'en-US', '+0530');
}
}
Here is a stackblitz link, you can edit here: https://stackblitz.com/edit/angular-h63y8e