bootstrap-ui-datetime-picker icon indicating copy to clipboard operation
bootstrap-ui-datetime-picker copied to clipboard

Configure datetime-picker to use a specific timezone, example Europe/London

Open sumit13587 opened this issue 8 years ago • 2 comments
trafficstars

How can we configure datetime-picker to follow timezone of Europe/London (UTC+001)?

We tried the following, which did not work:

<input ng-model="ordersModel.order.orderStartDate" type="text" id="orderStartDate" datetime-picker="MM/dd/yyyy HH:mm" class="form-control" ng-model-options="{timezone: 'Europe/London'}" datepicker-append-to-body="true" is-open="startDateCalendar.isOpen">

sumit13587 avatar Jul 12 '17 20:07 sumit13587

Guys,

Any update on this ?

vikey913 avatar Jul 20 '17 05:07 vikey913

I believe (but I might be wrong) it only supports time zone offsets.

E.g.: ng-model-options="{timezone: 'UTC+02:00'}

I'm having some trouble with this as it's not super accurate for things like Daylight Savings Time (the offset changes twice a year). Moment.js addresses this well (and understands something like 'Europe/London'), which I'm currently trying to integrate with the datetime picker.

Update (from https://docs.angularjs.org/api/ng/filter/date):

Timezone to be used for formatting. It understands UTC/GMT and the continental US time zone abbreviations, but for general use, use a time zone offset, for example, '+0430' (4 hours, 30 minutes east of the Greenwich meridian) If not specified, the timezone of the browser will be used.

jsantos avatar Nov 10 '17 08:11 jsantos