History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CIB-1966
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: 4 4
Assignee: jason
Reporter: Rohan McGovern
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Pulse

Include timezone in remote API

Created: 10/May/09 11:10 PM   Updated: 14/May/09 10:37 PM
Return to search
Issue 202 of 309 issue(s)
<< Previous | CIB-1966 | Next >>
Component/s: Remote API
Affects Version/s: None
Fix Version/s: 2.1.4, 2.0.30

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
The remote API provides timestamps to a client but doesn't send any timezone information, so the times are difficult to use in a meaningful way.

Example: I have an IRC bot which talks to Pulse via XMLRPC, it can give a summary of the last build for a particular project using `getLatestBuildsForProject'. For timestamps, I'd prefer it to present the information as `x hours ago', like the Pulse dashboard. But currently I can't implement that without giving the bot hidden knowledge about what timezone is set on the server.

 All   Comments   Work Log   Change History      Sort Order:
jason - 12/May/09 10:25 AM
I think perhaps we can add this as a single call to get the server timezone, rather than adding additional information to each timestamp returned by the API (currently Pulse does not store timezones with each stamp anyway, so it would return an identical zone for every stamp).

jason - 13/May/09 01:31 PM
Looking into this more, I found we use the unambiguous value of milliseconds since the epoch (UTC) for our stamps internally, but hoping to be helpful turn these into Dates when passing the out of the API. The problem with this is that XML-RPC dates do not preserve the timezone information, hence there is no way on the client side to interpret the date without guessing/knowing the server timezone.

My primary solution for this was to add two new fields to results: startTimeMillis and endTimeMillis which contain the unconverted milliseconds since the epoch. As these are 64-bit values they are pased as strings in the XML-RPC struct. My guess is that these will be fairly easy to work with to solve the reported use case.

Additionally, I have added a getServerInfo method that returns a struct of simple string values with information about Pulse and the environment it is running in. This includes the timezone (user.timezone) and also the current time (current.time) in milliseconds since the epoch on the Pulse server.

Refer to change 5907.

jason - 14/May/09 10:37 PM
Merged to trunk in change 5913.