Date Function questions

n1ql

#1

I have a docs like this:

{"type":"date","timestamp": 1436295124195}

where timestamp is UNIX milliseconds
I want to Converts date to the following format:

2016021722440230

where the format is

YYYYMMDDHHmmssnnnn

I find the build in Date function don’t support this format,
How should I write N1QL?


#2

Hi,

Use REPLACE(REPLACE(SUBSTR(MILLIS_TO_STR(myexpr), 0, 23), “-”, “”), “:”, “”);


#3

OK,Thanks, I got the idea.