File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • 0
  • 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
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • 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
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic