My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
TimeSpan  
Updated Apr 29, 2011 by bsautner@gmail.com

Explain how nimbits understands time span requests

Introduction

In any situation where Nimbits is receiving a text time range - that is a start and end date, submitted as a string, either in the UI or as a request to the WebService, Nimbits will use the same pattern to try and understand what the timespan being requested should be.

All Times are stored in a nimbits database as UTC time, Nimbits never modifies a time to adjust for time zones etc. Locales and time zones are adjusted on the UI.

A Timespan consists of a start and end. Start is the older date and End is the most recent date. Yesterday would be a start and today would be an end for example.

Details

One can view TimespanFactory.java which contains the logic for how Nimbits interprets a timespan based on two string inputs.

All web services that take a start and end date parameter for get and post request use the format sd=startdate&ed=enddate for a date range. See the Wiki for ChartApiService and SeriesService.

End Date Options

  • The end date can be any of the global options below, but can also be a special case: *(an asterisk) or now to have the current time. This is useful for requesting the current time on repeated requests.

Start Date Options

The end date is interpreted first so the start date can be processed relative to the end date. Start date can be any of the global options below or:

  • -s60 : 60 seconds before the end date
  • -m5 : 5 minutes before the end date
  • -h1 : One hour before the end date
  • -d4 : 4 days before the end date

Global Options

  • An absolute time in YYYYMMDDHHMMSS format i.e 20110428120000 for noon on April 28th 2011
  • Unix Epoch Time in Seconds 1304058325
  • Unix Epoch time in Milliseconds 1304058325000

see http://en.wikipedia.org/wiki/Unix_time


Sign in to add a comment
Powered by Google Project Hosting