Devang Mistry
Devang Mistry

Reputation: 593

Subtract minutes From time using angular 2/4

Currently I am working with ionic 3 with angular 4 project,In which I need to subtract 10 minutes from Time, which is picked from time picker in HH:MM format.

example :

   I have variable `X = 06:30` ; Now i have to subtract `10` minutes from `X`.

How it will get deal ?

Upvotes: 1

Views: 1170

Answers (1)

solimanware
solimanware

Reputation: 3051

Install moment guide

npm i moment --save

Import it

import * as moment from 'moment';

Use this this line of code

const res = moment("06:30","hh:mm").subtract(10, 'minutes');

Have a look at the example I created

Upvotes: 2

Related Questions