Quantcast
Channel: Mockaroo Community Forum - Latest posts
Viewing all articles
Browse latest Browse all 2665

Date format changes when using formula

$
0
0

Yeah, there is something funny going on with date arithmetic and the mongoDB format. This formula should get the job done, though:

{ "$date" => (this.raw + hours(12)).strftime('%Y-%m-%dT%H:%M:%S.%LZ') }

To add thirty seconds to each row, add a Row Number field and do something like:

{ "$date" => (this.raw + hours(12) + (seconds(30) * row_number)).strftime('%Y-%m-%dT%H:%M:%S.%LZ') }

Viewing all articles
Browse latest Browse all 2665

Trending Articles