Date Functions

Should we expect ISO 8601 support via date/time comparison functions in the future? Or should I start converting all of my string formatted dates in JSON documents to timestamps?

Your string-formatted dates are fine. We intend to add standard datetime representations, and ISO 8601 is certainly a candidate. But we would also add functions for parsing your existing strings into datetimes using custom formats. There’s no ETA on datetime support yet, but it’s part of the pipeline.

Sounds good. Thanks for the info.

Wouldn’t it be more efficient to store dates/times as integer timestamps, in particular when using a start_key and/or end_key when querying a view? Seems like a lot of overhead to have to parse a string for each row.

FYI, we’ve added DATE_PART() and NOW_STR() functions with the newly released N1QL DP2.

Geraldss, are these two the only date functions planned? These aren’t very useful for comparing or sorting by dates. Are we expected to, for example, do hierarchal sorts starting at date_part "year’, then “month”, then “day”, etc.? What about getting records between two dates?

I’m starting to think that timestamps are going to be the better way to go.

Jonathonl,

Thank you for the input. I’ve opened a ticket to add numeric datetime functions:

http://www.couchbase.com/issues/browse/MB-9881

Jonathonl,

Thank you for the input. I’ve opened a ticket to add numeric datetime functions:

http://www.couchbase.com/issues/browse/MB-9881

Lots of date functions now: http://blog.couchbase.com/n1ql-dp4-is-here