1 month, 1 week ago Olivier Bertrand

Sorry for the typo: the format made by MongoDB is actually YYYY-MM-DDThh:mm:ssZ. It is also what REST queries return when putting a date in their JSON answer.

1 month, 1 week ago Jan Steinman
#!/usr/bin/sed -E
s/,([12][0-9][0-9][0-9]-[01][0-9]-[0-5][0-9])T([012][0-9]:[0-5][0-9]:[0-5][0-9])Z,/,/1 /2,/

It assumes comma-delimited. If your fields are quoted, but a double-quote after the first comma and before the last one.

I'm assuming "Z" has something to do with time zone? Or does it refer to "Zulu time," commonly called GMT? If you need to account for time zone differences, that is a further complication. If out and in have the same time zone, just ignore the zed.

I haven't actually run this. It probably has a syntax error or two. :-)

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.