Date Functions


#1

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?


#2

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.


#3

Sounds good. Thanks for the info.


#4

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.


#5

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


#6

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.


#7

Jonathonl,

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

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


#8

Jonathonl,

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

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


#9

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