My goal is open a text.txt with 3 different dates and times in UTC
- 2020-07-31T21:43:00.000Z
- 2020-07-30T21:43:00.000Z
- 2020-07-28T21:43:00.000Z
modify those dates in EST time and write on a text2.txt file
I know how to open text.txt and write the same 3 dates on text2.txt, but I have no idea how to convert the dates under text.txt
// Require the given module
var fs = require('fs');
// Use readFile() method
fs.readFile('text.txt', 'utf-8', function(err, data) {
// Write the data read from text.txt
// to a file text2.txt
if( !err )
fs.writeFile('text2.txt', data, (err)=>{
if( err ) {
throw err;
}
});
else
throw err;
});