2017년 6월 21일 수요일

Time zone issues - Clock MakeInstant


I've been following the Countdown to Christmas tutorial as I want to make a countdown app to a race that I organise.

I'm based in the UK, and I have set:-

Call Clock.MakeInstant from "07/30/2017 09:30:00"

The problem is, that the countdown timer on my phone is an hour out. Instead of showing the days, hours, minutes and seconds until 30th July 2017 09:30, it is showing the days, hours, minutes and seconds until 30th July 2017 08:30

Is there a way of setting the clock to use the timezone of the device that the app is running on?

--
There's an extra complication to consider.

Daylight Savings Time kicks in this weekend here in the US late Saturday night,
stealing an hour of sleep (and countdown time) from us.

-- 
I started on an extension to include date utility helper-methods.
Currently only 2 methods available:
1. Get current date / time in specified format
2. Calculate day, hour, min, sec difference between 2 different dates.

Item 2 above can be used to calculate current date/time to any date/time such as now to Christmas or new year.

The extension can be downloaded from link below:


-- 
Just FYI, based on needs, I'll be adding more helper methods.

--

댓글 없음:

댓글 쓰기