Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Ion-datetime Does not use local Timezone

$
0
0

@dominic-ks wrote:

Howdy folks,

According to the docs - https://ionicframework.com/docs/api/datetime - “Important: ion-datetime will always display values relative to the user’s timezone”

Just trying to see this work as expected with a mega basic example:

<ion-datetime displayFormat="DD/MM/YYYY HH:mm" value="2019-07-15T18:00:00+00:00"></ion-datetime>

This will display “15/07/2019 18:00”.

I am currently in BST, i.e. GMT / UTC +01:00, so I would be expecting the first example to show “15/07/2019 19:00”, i.e. identifying that I am in fact an hour ahead.

NB. if I add this using the angular date pipe:

<div [innerHtml]="'2019-07-15T18:00:00+00:00' | date:'medium'"></div>

Then I get “Jul 15, 2019, 7:00:00 PM”, which is what I’d expect.

In the meantime I think I will need to change the date before giving it to the input and then change it back before processing it, but I’d really rather not!

Any pointers?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>