I am using ngb-timepicker in my angular application. I want to compare the user entered time with the current time so that I can add some validations. The current time I can get using the new Date() object and use currentDate.getTime() but how to I compare this to the time entered in ngb-timepicker.

The time output I get in ngb-timepicker is {hour: 16, minute: 3, second: 0}. Is there a way to convert this to the new Date() object or how can the 2 timing be compared?