Android Question Getting UK time from the net, incl DST.

malcfreem

Member
Licensed User
Longtime User
Hi. I have used the following code to get GMT from the net, but that isn't quite what I need.

I need the time including any daylight saving time, ie exactly as it is when you are in the UK and looking at your watch (we are on GMT until late April, then DST kicks in until October).

I'm pretty sure the solution is simple, but can anyone show me please?

Sub Get_Current_Time
Dim Timezone As Double
Timezone = DateTime.GetTimeZoneOffsetAt(DateTime.Now)
DateTime.SetTimeZone(0)
sntp.NtpServerName = "0.uk.pool.ntp.org"
sntp.TimeOut = 10000
ticks = sntp.getGmtNtpTime
DateTime.SetTimeZone(Timezone)
End Sub


Thank you
 

malcfreem

Member
Licensed User
Longtime User
Hi. Because the user would be able to change that and therefore become eligible for special offers outside the date/time the offer is meant to run for. E.G. if an offer had closed at 4pm yesterday, they could simply change their device date/time/time zone and become eligible.
 
Upvote 0

malcfreem

Member
Licensed User
Longtime User
No that is not workable in this case. The seller advertises an offer which runs from 10am to 2pm at an event. They look at their watch on 1st June and it says 10:30 am. GMT will be 9:30 am so that wont work the only way for it to work would be to advertise the offers in GMT, but that is simply not the time people will be using or seeing on their watch. I need GMT (which I can get) plus 1 hour in DST and +0 at other times of year
 
Upvote 0
Top