const a = require('./luglio_2001-bot.json') const dayjs = require('dayjs') const fs = require('fs') const r = a.sort((a,b) => dayjs(`${a.date} ${a.time}`)-dayjs(`${b.date} ${b.time}`) ) fs.writeFileSync('./sorted.json', JSON.stringify(r, null, 2))