• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get the exact time from a google spreadsheet using app script?

 
Ranch Hand
Posts: 806
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all, I am Chaitanya, I am sorry if I post a wrong question here.

I have a google spreadsheet, where there is a column to store the an event's time.

Suppose that it is 16:45:00.

When I use google app script to retrieve the cell's value like:

var a=dataSheet.getSheetValues(144, 1, 1, 7);
new Date(time).toTimeString()

it is showing

14:38:24 GMT+0530 (IST).

My spreadsheets timezone is (GMT +08:00) Hong Kong.

I know that due to the spreadsheets timezone and my browser's timezone, I am getting an unexpected value.

Can anyone tell me how to retrieve the exact time i.e. 16:45:00.

Thank you all in advance.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question is not really suitable for the GWT forums. Let us try the HTML/JS forum. Moving thread.
 
chaitanya karthikk
Ranch Hand
Posts: 806
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys, the problem has been solved. It is all due to separating the date and time value.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic