Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • 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.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • 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
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, the problem has been solved. It is all due to separating the date and time value.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!