Skip to content

Instantly share code, notes, and snippets.

@sysnajar
Created May 26, 2018 03:05
Show Gist options
  • Save sysnajar/62e3679914c606d843ffb1108287d385 to your computer and use it in GitHub Desktop.
Save sysnajar/62e3679914c606d843ffb1108287d385 to your computer and use it in GitHub Desktop.
jq generate Date field from string fields (createDate and createTime)
./list_dopa.lua | jq -c '.data []| {date: (.createDate + .createTime[0:5]) | strptime("%m/%d/%y%H:%M") | mktime , date2: (.createDate + .createTime[0:5]) | strptime("%m/%d/%y%H:%M") | todate, createDate: .createDate, createTime :.createTime, id : ._id}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment