How to get current date and time in TypeScript
To retrieve the current system Date/Time in javaScript/TypeScript you need to create a new Date
object using parameterless constructor, like this:
let dateTime = new Date()
If you use angular and Moment type
import * as moment from 'moment';
...
//Change DATE_TIME_FORMAT by the format need
const DATE_TIME_FORMAT = 'YYYY-MM-DDTHH:mm';
let _now: Moment;
_now = moment(new Date(), DATE_TIME_FORMAT);