Timekit developers

Types & formatting

Date formats

Our API is build around the idea that the client should control the response as much as possible. So when you make requests, you can decide the date format that will be returned, like so:

Input and output date formats are set in the header or in a query params.

To choose output format use: Timekit-OutputTimestampFormat To choose input format use: Timekit-InputTimestampFormat

Default format: ISO_8601 eg. 2016-05-26T15:30:00+00:00

curl
curl -X POST \
     -H 'Timekit-App: back-to-the-future' \
     -H 'Timekit-OutputTimestampFormat: Y-m-d h:ia' \
     -u doc.brown@timekit.io:nvHfRSlhvsnlg4rS7Wt28Ty47qdgegwSu3YK7hPW \
     -d '{
           "emails": [
             "doc.brown@timekit.io",
             "marty.mcfly@timekit.io"
           ],
           "future": "2 days",
           "length": "30 minutes",
           "format": "Y-m-d h:ia"
         }' \
     https://api.timekit.io/v2/findtime

This will return:

json
{
    "data": [
        {
            "end": "2015-04-24 09:30am",
            "start": "2015-04-24 09:00am"
        },
        {
            "end": "2015-04-24 12:15pm",
            "start": "2015-04-24 11:45am"
        },
        {
            "end": "2015-04-24 06:15pm",
            "start": "2015-04-24 05:45pm"
        },
        {
            "end": "2015-04-24 08:15pm",
            "start": "2015-04-24 07:45pm"
        },
        {
            "end": "2015-04-25 08:00am",
            "start": "2015-04-25 07:30am"
        }
    ]
}

The data format is defined in the format params, where the following options is available:

Format Description Example
d Day of the month, 2 digits with leading zeros 01 to 31
l (lowercase 'L') A full textual representation of the day of the week Sunday through Saturday
m Numeric representation of a month, with leading zeros 01 through 12
Y A full numeric representation of a year, 4 digits Examples: 1999 or 2003
a Lowercase Ante meridiem and Post meridiem am or pm
h 12-hour format of an hour with leading zeros 01 through 12
H 24-hour format of an hour with leading zeros 00 through 23
i Minutes with leading zeros 00 through 59
s Seconds, with leading zeros 00 through 59
Y-m-d\TH:i:sO ISO 8601 date 2004-02-26T15:19:21+00:00
U Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) 1429866000

Timezones

Every timestamp on Timekit is saved in UTC by default. Timezones are written and formatted using the Country/City convention, like America/Los_Angeles

Each resource has a timezone and it can be retrieved by calling the /resources/me endpoint:

json
{
    "data": {
        "activated": true,
        "email": "doc.brown@timekit.io",
        "first_name": "Dr. Emmett",
        "img": "http://www.gravatar.com/avatar/7a613e5348d63476276935025",
        "last_name": "Brown",
        "last_sync": null,
        "name": "Dr. Emmett Brown",
        "timezone": "America/Los_Angeles",
        "token": "nvHfRSlhvsnlg4rS7Wt28Ty47qdgegwSu3YK7hPW",
        "token_generated_at": null
    }
}