Hello, on an android device, this code shows the correct time, but in iOS, its showing wrong
{{item.date | date:‘HH:mm’ }}
My timezone is -0300 but how i configure it in the code?
e.g
android 16:20
ios 14:20
Hello, on an android device, this code shows the correct time, but in iOS, its showing wrong
{{item.date | date:‘HH:mm’ }}
My timezone is -0300 but how i configure it in the code?
e.g
android 16:20
ios 14:20
Any idea about this problem?
Have you set the same timezone on both devices?
Yes, same timezone on devices, in the project should I configure something?
Take a look at the domumentation, You can configure the timezone
https://angular.io/api/common/DatePipe#description
{{item.date | date:‘HH:mm’:'CET' }}
I had a conversation with a poster here, who said that i18n didn’t work well with iOS, so the Angular date pipe had issues, and that’s why he used date-fns instead for his date pipe. Not sure how to find the link. But you might want to use date-fns or moment, instead of the Angular date pipe.
Hello, I use ‘UTC’, but in this way, works in iOS, but doesnt work in android, without timezone configured, works in Android but not in iOS.
thanks for the reply
I update to angular 5.1.2, still the same thing.
So u made work for both devices. What about the dirty way and implement both versions and only Show the correct one with showWhen="ios"
?
Im gonna take a look, thanks
Any luck with this. I’m trying to use the datepipe transform to format the date differently.
I have angular 5.0.0
On ios it doesn’t seem to look at the timezone at all. its always 5-6 hours behind.