Just a quickie. I need to make a few Google Sheets scripts for some side projects, and struggle finding some basic low-level tools in Google API docs. For instance, you can't find String object documented....but it's still in there.
So I managed to successfully use function such as
toDateString
substring
indexOf
wondered why, and probable answer (not obvious to me) is that they are supported as a part of JavaScript which you can use in Google Script editor. Seems google just went so abstract in what they want developers to use form Google API services and apps that they dropped maintaining documentation for generic stuff like above. It causes some confusion, at least for me (I haven't been following any updates for devs from g's side).
Next time I will just remember.
Anyway, if you want to convert a cell contents which behind the scenes is stored by the sheet as:
Thu Dec 11 2014 01:00:00 GMT+0100 (CET)
to some more human readable form
use toDateString which yields
So I managed to successfully use function such as
toDateString
substring
indexOf
wondered why, and probable answer (not obvious to me) is that they are supported as a part of JavaScript which you can use in Google Script editor. Seems google just went so abstract in what they want developers to use form Google API services and apps that they dropped maintaining documentation for generic stuff like above. It causes some confusion, at least for me (I haven't been following any updates for devs from g's side).
Next time I will just remember.
Anyway, if you want to convert a cell contents which behind the scenes is stored by the sheet as:
Thu Dec 11 2014 01:00:00 GMT+0100 (CET)
to some more human readable form
use toDateString which yields
Mon Jan 12 2015
straight from JS: http://www.w3schools.com/jsref/jsref_todatestring.asp
or put his bit of code:
var month = data[row][col].getMonth() + 1;
var neatDate = data[row][col].getDate() + "/" + month +"/" + data[row][col].getFullYear();
good luck!
Excellent information, for best It training's with placements
ReplyDeletewebsphere Online Training
This blog is nice and very informative. I like this blog. blog Please keep it up.
ReplyDeleteInformasi Lengkap Mengenai Cara Mengalahkan Bandar Sabung Ayam Online S1288
ReplyDeleteAgen Sabung Ayam Online Terbaik Dan Juga Terpercaya https://sabungayamlive.net/
Informasi Terlengkap Mengenai Sabung Ayam
http://bvayamsate.blogspot.com/2018/09/bentuk-jalu-ayam-yang-mematikan-di.html/