I am using AngularJS to get date from service 2014-09-29 and time as 191042 .
I need to show something like this
29 September 2014 19:10:42 ET
How do I convert it according to eastern time zone as I am getting date & time separately?
I am using AngularJS to get date from service 2014-09-29 and time as 191042 .
I need to show something like this
29 September 2014 19:10:42 ET
How do I convert it according to eastern time zone as I am getting date & time separately?
You can format with a filter {{ date_expression | date : format : timezone}}
, in your case: <span>{{datevar | date:'d MMMM y'}} {{timevar | date:'HH:mm:ss' : '-0500'}} ET</span>
all the formats you find here: https://docs.angularjs.org/api/ng/filter/date. Check out at this plunker: https://plnkr.co/edit/l7ayOKSPGJp3Uvbfgtlx?p=preview. Completing the answer, if you need to ajust in summer time you can set the local with angular-locale
plugin as you can see at this post: Angular JS - Date changes when submitting to $http - Timezone issue