Why TFS ServiceHooks delayed? - tfs

Why TFS ServiceHooks delayed in a few hours before it works.
In the history of the ServiceHooks it shows at Summary, sent at 11:13 while the response was at 09:13

Please check the web hooks sent time from history (reference below screenshot),
Take a look at the time setting(eg: China Standard time here) to check it’s the real delay but not due to Time zone difference.
If the delay happens consistently and each time delay hours, highly doubt it's a time zone difference, not a real delay. Please double check your server time zone and web site's.

Related

Check if system time is auto or user set

I need to set up user proof time keeping in my current project. I have found a lot of different question around this, but none that seem to have the answer I am looking for. These are the questions i have looked at so far:
XCODE: How to get/verify ACCURATE timestamp from device
Is it possible to get the atomic clock timestamp from the iphone GPS?
How can I get the real time in iPhone, not the time set by user in Settings?
I have several options for getting a time from a server connection but I need to have an offline solution too.
1.
It seems that using CLLocation gets the same time as as the device clock. Is there away to get the actual GPS time?
2.
I know the system time settings are not a public API thus can't be changed. Is it possible to find out if the device has the auto time setting turned on? If the auto time is on then I can rely on the system time for my purposes and if it's off then record that so I know that the time recorded is not to be trusted?
Just wanted to post my solution, incase some one else has the same issue.
After much research i found that getting GPS time of time setting info was not possible.
This solution isn't perfect nor real time but works for my purpose.
I have implemented a time check using cloud time each time the app comes on line. When the device re-establishes a server connection to sync events created off line i have put a verification that takes the last object device time and the new object device time and calculates the elapsed time between the two. (using NSdates so that daylight savings is covered) then do the same with the last available server time and the most recent server time. I then compare the results and if they are not within my margin of error the events are marked as invalid.
Hope that makes sense and is helpful for others.

iOS Time change notification and previous time

I have an application that works with timeout (let's say -> ring in 3 days). My problem occurs if a user change the device local time while being offline because I am comparing two NSDate (the final date and today) to check that timeout.
So I am trying to get notified when a user made a significant time change (several hours or days) in order to update my timers depending on the difference between before and after the update.
I found the UIApplicationSignificantTimeChangeNotification, which does :
Posted when there is a significant change in time, for example, change to a new day (midnight), carrier time update, and change to or from daylight savings time.
That nearly fits but I can't figure out how to get the "old" time in order to get the difference. I can't rely on a webserver neither because the app should be running in offline mode.
Any idea or suggest is welcome ;)
I finally find a way to solve my problem by using the CPU time (which is always constantly increasing except on reboot).
First time the app is launched, I get the Real time and the CPU time.
Then, when I need to check if time has been changed, I just take
the Real time at first, I add to it ( the current CPU time - the CPU time at first).
This give me the correct time.
Note: take care to use the real CPU time, not the one used by timer because it's stop when device go to sleep.
You should store the current time of your device, when your application goes into background. When the application comes into foreground, you should take the current time of your device. Now measure the difference between these 2 dates. If it is less than zero, it means, the user has set the device with previous date and you should throw the error of time out. If the difference is greater than 0, then you should compare current time with actual finish date.
One more indirect way is to start the location tracking of your device. Keep it on even when the app goes into background. When your didUpdateLocation delegate will hit by system, you will receive CLLocation object in argument. This location object is having currentTime details. Compare the time of last location and current location. If it is negative, user has bluffed with time. Its time to take the action.

Getting updated server time every second

I have a requirement where I need to know what is the server time at a given point of time in the app. As soon as the app connects to server, the server sends back the time and I am not sure how to update this time.
I thought of using the timers where the method is called every second and and a second is added to server time, so that whenever I ask for server time it is always updated one. But problem with this if we schedule this on main runloop, the run loop may or may not process the timer request if there it is busy.
So how to track the server time?
Thanks
Your server is in a specific time zone correct? Just get the time zone of the server using a request and show the time in that time zone in your app. You can then use a timer to continue updating the time every second.
I suggest getting just the time zone because if you get the server's time, there would be a lag between when the server sends back the response and when you get it - which defeats the whole purpose of getting the time as on the server.
You can't update the iOS system time from your app; there is no API
for that.
iPhone's time is usually very accurate. On iPads, it varies but has improved with iOS 5 to +/- 5 seconds if some form of internet connectivity is available.
If you want to manually connect to a server to synchronize time, you
should do it in a background task.
To compensate for latency, you should make multiple requests and add
the average half of the roundtrip time to the time sent by the server.
However, the question remains: Why do you want to do that anyway?

Quartz.NET and daylight savings issue

We have a Quartz.NET cron trigger setup that needs to execute a job using the following schedule:
At 02:00hrs in the merchants time zone daily
However, when Daylight Savings Time (DST) occurs abnormalities occur i.e:
When the merchants timezone moves from +2 GMT to +3 GMT, the job does not get executed.
When the merchants timezone moves from +3 GMT to +2 GMT, the job does gets executed twice.
We already know that this behaviour is by design (http://www.quartz-scheduler.net/faq.html#daylight) but what are people using as a solution to this DST issue?
Cheers
Billy Stack
The link you point to may have been updated in the three years or so (!) since you asked this question. It would appear that the job should not be executed twice.
I'm unsure whether 02:00 officially 'occurs' in the US when daylight savings starts, so the concern about the job skipping execution at 02:00 could be resolved by setting it to 01:59:59 (cron trigger "59 59 1 ? *"), as long as you were in North America. Other countries may change at a different time of night. In Europe, for instance, the change is at 01:00, so there it would be better to set the trigger to 02:00:01
Just experienced the same issue as well, although in my case the trigger was not scheduled to fire between 0:00 and the DST change time (2:00 in the US). Instead, I had a job that runs MON-FRI at 8 in the morning, so it ran twice on the Monday November the 5th, the day following the DST change day.
If you read the FAQ item linked to in the question, it kinda makes sense. The Cron trigger wakes up, fires the job, then calculates next time to wake up. When it woke up on Friday at 8am, it calculated next time to run as Monday at 8am. However, by Monday morning what used to be 8am became 7am, so the trigger fired at that time. And then when it ran, the next time was "correctly" calculated as 8am, so it ran again at that time also.
Hope this helps somebody struggling to understand the issue.
Jobs run twice in the fall and don't run at all in the spring. It doesn't matter what time they are scheduled. The question was and still is, "How do you stop this from happening?" If you manually delete all jobs after the time change and before they run then add them back then it works fine. I haven't looked at it yet but thinking this could be automated. Write something that reads all scheduled jobs and adds them and deletes the old records. Whatever you write would need to run from the Windows job scheduler because it wouldn't run at all in the spring if it ran from Quartz.

Detect a transition in or out of daylight savings time with Delphi

I need to trigger an event when the PC transitions into or out of daylight savings time. I could monitor the current state with GetTimezoneInformation and check it every second waiting for a change, but I just thought there might be a simpler way that didn't involve continuous checking.
The Delphi TZDB helps you keep track of the algorithms on when a transition should have occurred.
--jeroen
According to this
http://www.pcreview.co.uk/forums/thread-1469513.php
windows doesn't send a WM_TIMECHANGE on daylight savings event. Workarounds(I didn't use any of them, so I'm not sure if it works):
check the local time every few seconds or so (yuck)
change your calculations to be based on GMT
watch the
HKLM\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias
value by using RegNotifyChangeKeyValue() (this value changes when there is a
DST transition as well as when the time zone changes).
Best regards,
Radu
For the UK at least (not sure of other countries) the transition only occurs on a Sunday morning so that could help reduce the frequency of your checks to just a few hours of each week. Additionally (for the UK again) this always occurs on the last weekend of March and October so you can further reduce the period for which you need to perform checks.
If you can collect the rules for each country that you are interested in and code their logic then that will obviously be more efficient than a continuous check but of course you are then responsible for being correct rather than relying on the OS.

Resources