2

Checked several other Stack Overflow Questions, searched for a while through all unknown date format questions, none I found look like this. I need to deal with this type of date time format in Javascript, which Google Sheets and LibreOffice Calc both are able to recognize and parse as 5/24/2023 10:00 for this example.

45070.416666666664 <- what date time format is this?

Greggory Wiley
  • 392
  • 2
  • 14

1 Answers1

0

In GSheets (as others), change format to date.

In app script, use

function myFunction() {
  const sh = SpreadsheetApp.getActiveSheet()
  const value = sh.getRange('C1').getValue()
  console.log (Utilities.formatDate(value, Session.getScriptTimeZone(), "MM/dd/yyyy HH:mm"))
}
Mike Steelson
  • 11,710
  • 2
  • 4
  • 19