Classic - the moment you write something, it suddenly dawns on you⦠its the other way around. (ZTimezone id: 'America/Halifaxâ) gmtToLocal: ZTimestamp now⦠Tim
On 15 Jul 2017, at 00:34, Tim Mackinnon <tim@testit.works> wrote:
Thanks for chipping in - but its the other way around that Iâm after.
I am looking at ZTimestamp now -but again I donât quite get it?
ZTimestamp now gives me a timestamp in UTC (great) but how do I format it to show it in say Canadian time?
I thought it would be something like:
ZTimestamp now printOn: stream timezone: (ZTimezone id: 'America/Halifaxâ) but it doesnât seem to be that?
I must be missing something.
Tim
On 14 Jul 2017, at 23:28, Norbert Hartl <norbert@hartl.name> wrote:
Have a look at #asLocal
Norbert
Am 14.07.2017 um 23:04 schrieb Tim Mackinnon <tim@testit.works>:
Hi - Iâm really confused about DateAndTime support in Pharo?
If I have a server app running in the EU, and a user makes a request from Canada, and I want to format the time they see to be in their timezone - how do I do that with the classes in Pharo?
I can ask for a DataAndTime nowUTC, and if I know the user is in en-CA, I can create a Locale for them - but then how do I get the correct time offset, or how to I format that UTC date in their locale?
Tim