2
votes

I am using the VSTS REST API to get some information about the iterations of a specific project, specifically the method at this link: https://www.visualstudio.com/en-us/docs/integrate/extensions/reference/client/api/tfs/work/restclient/workhttpclient2_2#method_getTeamIterations

All of the information I'm requesting is there, but the start and finish dates for each iteration are being adjusted based on my local timezone. So an iteration that has an end date of today, Wed May 31 2017, will come back with a finishDate that looks like this:

Tue May 30 2017 19:00:00 GMT-0500 (Central Daylight Time)

I have some code that looks through these iterations using the current date to find which iteration is underway, so when it's run on the last day of an iteration, it's being tricked by this returned value into thinking that the next iteration has already started, or that we're outside of the actual current iteration.

Is this unintended behavior, or is there something I'm missing?

1

1 Answers

3
votes

From my experience, this is expected behavior. TFS will convert your input date time values into UTC and store those value in database.

Likewise, when you are querying those date time values, it will convert back to your current timezone which is defined by the user context that you are using. Let say if you are using your credential then it's in your personal account settings (Click your profile in the top right corner, and there is a timezone setting).