When I am copying timestamp from one sheet to another or in the same sheet only then it is not copying the time from the timestamp. It is only copying date. See the below image -
Here is my code -
function myFunction() {
var files = DriveApp.getFilesByName('myfile');
while (files.hasNext()) {
var file = files.next();
var ss = SpreadsheetApp.open(file);
var sheet = ss.getSheets()[0];
var lastRow = sheet.getLastRow();
var range = sheet.getRange(1,1,lastRow,2);
var values = range.getValues();
Logger.log(values);
var range = sheet.getRange(sheet.getLastRow()+1,1,lastRow, 2);
range.setValues(values);
}
}
The logger contains this information -
[18-10-20 11:18:17:743 PDT] [[TIMESTAMP, EVENT], [Mon Oct 01 05:10:13 GMT+05:30 2018, Event 1], [Mon Oct 01 05:10:16 GMT+05:30 2018, Event 2], [Mon Oct 01 05:10:17 GMT+05:30 2018, Event 3], [Mon Oct 01 05:10:24 GMT+05:30 2018, Event 4], [Mon Oct 01 05:10:26 GMT+05:30 2018, Event 5], [Mon Oct 01 05:10:32 GMT+05:30 2018, Event 6], [Mon Oct 01 05:10:38 GMT+05:30 2018, Event 7], [Mon Oct 01 05:10:38 GMT+05:30 2018, Event 8], [Mon Oct 01 05:10:45 GMT+05:30 2018, Event 9], [Mon Oct 01 05:11:07 GMT+05:30 2018, Event 10]]
What could be the reason?
