Re: Times in other cities
Re: Times in other cities
- Subject: Re: Times in other cities
- From: Alex Zavatone <email@hidden>
- Date: Thu, 18 May 2017 21:36:22 -0500
From what I remember, it was important to not only set the region, but also the locale of the target location you wish to show the time in.
The switching of EST to EDT and GMT to BST are handled automatically as mentioned below, but the real world implications are more important.
While my office is in Boston (EST or EDT), and I’m in Dallas (CST or CDT), part of our team is in Costa Rica.
Now, for me and Boston, I’m always one hour earlier in Dallas, no matter if it’s daylight savings time or not. But for Costa Rica, it gets messy. At some times of the year, San Jose, Costa Rica, is 1 hour earlier than Dallas and at some times, it’s the same time. So, while my time zone based on my location is always 1 h < than EST, the difference in time between offices for our friends in the Costa Rica office varies depending on when WE enter and leave DST, because they don’t observe it.
One more example. While in the US, the DST time changes on the second Sunday in March at 2 AM, but in Eastern Europe, it changes a week earlier. Just for this case, there is one week where there is another hour of difference ± between the time in the US and in Eastern Europe - or parts of it.
I could go on, but you see what I’m getting at. Setting the locale and region of your target where you want to display the time magically handles all of this for you.
Then just set up a date formatter and display it.
Cheers,
Alex Zavatone
> On May 15, 2017, at 8:38 AM, Eric E. Dolecki <email@hidden> wrote:
>
> Got it - I understand now. And I kindly thank you for the clarification.
>
> On Mon, May 15, 2017 at 9:31 AM Andrew Thompson <email@hidden> wrote:
>
>> BST is British Summer Time, but also Bering Standard Time (UTC-11). Do you
>> want to risk getting the wrong one?
>>
>> The UK observes daylight savings time, which being in Boston you no doubt
>> understand means half the year the name of the time zone changes. In Boston
>> Eastern time switches from EST to EDT and in London it's GMT to BST. Most
>> likely the libraries will do something reasonable if you ask for daylight
>> savings time in the dead of winter, but why risk it? If you want wall clock
>> time in London as someone would see it if they were sitting there, just ask
>> for Europe/London. Safer.
>>
>> Andrew.
>>
>>
>> On May 15, 2017, at 9:17 AM, Eric E. Dolecki <email@hidden> wrote:
>>
>> Europe/London = BST though, correct?
>>
>>
>>
>>
>>
>> On Mon, May 15, 2017 at 9:06 AM Andrew Thompson <email@hidden> wrote:
>>
>>>
>>>
>>>> On May 15, 2017, at 8:50 AM, Eric E. Dolecki <email@hidden>
>>> wrote:
>>>>
>>>> Thanks for your reply. Does this look safe to use?
>>>>
>>>> // London
>>>> let locale = TimeZone.init(abbreviation: "BST")
>>>>
>>>
>>> Use "Europe/London":
>>>
>>> 1. BST has at least 3 different meanings
>>> 2. You'll automatically get support for daylight savings (summertime)
>>> 3. More readable in code
>>>
>>>
>>> Andrew
>>>
>>>
>>>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden