I have an Rails/Grape API that uses PostgreSQL DB With my endpoints to POST, PUT and GET it takes a time format like
2:00pm
and converts to
2000-01-01T14:00:00.000Z
No biggie here. The problem is when I tried to show this with my angularJS front end.
It shows the 2:00pm above as
6:00AM -0800, Jan 1, 2000 6:00:00 AM
-0800 is PST which is the correct timezone. I even set Heroku servers timezones by using
heroku config:add TZ="America/Los_Angeles"
I tried to use angular and moment to to see it in realtime
<input ng-model="test_form" class="form-control" value="2000-01-01T14:00:00.000Z">
<h3>angular: {{test_form| date:'dd MMM yyyy - hh:mm a'}}
<br>moment: {{test_form | amDateFormat: 'M/D/YYYY h:mm:ss A' }}</h3>
and here are the output for 2000-01-01T14:00:00.000Z
angular: 01 Jan 2000 - 06:00 AM
moment: 1/1/2000 6:00:00 AM
I want it to show the formatted time 1/1/2000 02:00:00 PM
Any help will be much apreciated