Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8894827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:36:25+00:00 2026-06-14T23:36:25+00:00

I have a spreadsheet which we use to log our work. I have read

  • 0

I have a spreadsheet which we use to log our work. I have read the date’s column from the sheet into an array so that I can perform actions/calculations on them. This did not work for me as I noticed in the debugger that the array which holds the dates have values different formats of the date values. For instance, some display as “16/11/2012” and some as (new Date(1355184000000)).

Can someone point a way to convert them all to a unified format so that I can work with them?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:36:27+00:00Added an answer on June 14, 2026 at 11:36 pm

    How do you want your dates to be shown? Do you want them to be ‘date objects’ or strings? the value you show in your code (new Date(1355184000000)) correspond to Mon Dec 10 16:00:00 PST 2012
    You can check that by using Logger.log(new Date(1355184000000))

    On the contrary "16/11/2012" is most probably not a date but a string…(note : strange that you use a “day/month/year” sequence since I saw on your profile you are in UK, I thought you’d use mm/dd/yyyy instead).

    Since you said you need to make some calculations on these items I guess that they all should be converted to date objects for using them in you script.
    I’d suggest you look at some documentation on date object to see exactly how this should be done without generating errors. Don’t forget that dates in javascript are always dates and time in hh:mm:ss and milliseconds. The integer value you saw was the number of milliseconds since January the first in 1970 😉
    You could also do a search on dates in this forum and find quite a lot of interresting informations.

    Here is a small function to illustrate :

    function playWithTime(){
    Logger.log('ref date = '+new Date(0))
    var example = "june 30, 2013 23:59:00"
    Logger.log(example+' = '+ new Date("june 30, 2013 23:59:00"))
    Logger.log(example+' = '+ new Date("june 30, 2013 23:59:00").getTime()+' mS')
    }
    

    It will show this in the Logger :

    ref date = Thu Jan 01 1970 01:00:00 GMT+0100 (CET)
    june 30, 2013 23:59:00 = Sun Jun 30 2013 23:59:00 GMT+0200 (CEST)
    june 30, 2013 23:59:00 = 1372629540000 mS
    

    btw, note that the Logger returns values in different ways, depending on the daylight saving in your timezone… I’m in Belgium and june is in ‘summer’ time (CEST). It can also be shown in PDT or PST which is the timezone of Google servers. You can’t rely on the logger to be constant (!!) but that’s another story 😉


    EDIT : If your date strings are in the form dd/mm/yyyy then you should probably reorder it like in this code :

    function playWithTime2(){
    Logger.log('original date string in UK format = 16/11/2012')
    var d = "16/11/2012".split('/');
    var d_ordered=d[1]+'/'+d[0]+'/'+d[2]
    Logger.log('becomes '+d_ordered+' = '+new Date(d_ordered))
    }
    

    Which returns

    original date string in UK format = 16/11/2012
    becomes 11/16/2012 = Fri Nov 16 2012 00:00:00 GMT+0100 (CET)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Like many, I have spreadsheet that draws data from over 40 text files as
I have a spreadsheet that I am sorting based on an item number column.
I have an Excel spreadsheet that I have exported from some other program. It
I've noticed that when I use SSMS to import an Excel spreadsheet into SQL
I have a C# Silverlight app that lets the user select which spreadsheet they
I have a spreadsheet that has a small number of inputs, which drive a
I have an application that uses COM interop to create a spreadsheet which is
I have a spreadsheet I created mid-August which has a table with one column
I have a spreadsheet which contains 'unique' IDs. The problem is that they are
I have a spreadsheet which has a column on it (say column A). The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.