2

Need to bind time from the format "yyyy-mm-ddThh:mm:ss" . But some minutes are not binding correctly. used foloowing fomatting technique.

    {{myDateTime| date:"HH:mm" }}

Example 1: myDateTime - "1900-01-01T08:00:00" viewed as - "07:49" Need as - "08:00"

Example 2: myDateTime - "1900-01-01T23:00:00" viewed as - "22:49" Need as - "23:00"

Adikari Nadeesha
  • 322
  • 3
  • 12
  • I see no problem with that, here is a plunk: https://plnkr.co/edit/VvM1neeDgG2IcPVc8irp?p=preview – FAISAL Aug 01 '17 at 10:29
  • I had such issue. The problem was the javascript was taking time provided by API as a UTC time. The conversion was done onto that at server side and it worked fine. – Maulik Modi Aug 01 '17 at 11:18

1 Answers1

1

I commented here on this. The formatting codes are specifically listed here. That should be a 24hr clock with seconds having leading zero if under 10 seconds. So looks ok to me. Your dates have century of 1900. That looked odd btw. But this.myDateTime = new Date(1900, 0, 1, 8, 0); outputs good time for me too in the plunker.

JGFMK
  • 8,425
  • 4
  • 58
  • 92