File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes How to get the exact time from a google spreadsheet using app script? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to get the exact time from a google spreadsheet using app script?" Watch "How to get the exact time from a google spreadsheet using app script?" New topic
Author

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

chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

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.


Love all, trust a few, do wrong to none.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

This question is not really suitable for the GWT forums. Let us try the HTML/JS forum. Moving thread.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

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
 
subject: How to get the exact time from a google spreadsheet using app script?