couchrest/couchrest_model — Issue #134: Add miliseconds to Time#as_json
Author: samlown
Created: 2011-12-30 11:18:58+00:00
State: open
Labels: Feature Request

When dealing with multiple documents being stored in quick succession the number of milliseconds can be an important factor to ensure that views when ordered using a timestamp always return the documents in order. Given that CouchDB orders cannot be guaranteed, this should be supported.

Javascript by default (from Node.js for example) already adds the milliseconds to the time objects stored.

New suggested default storage format from to_json:

2011-12-30T12:15:23.123Z

When dealing with dates for human consumption, as usual, the DateTime class should be used instead.

Cheers,
sam