カテゴリー 「Google Apps Script」 RSS

2015-02-05

[] Utility formatDate における timezone の指定について。

たぶんどこにも書いてないのでメモ

https://developers.google.com/apps-script/reference/utilities/utilities#formatDate(Date,String,String)]

timeZone のフォーマットについての言及がないが、"GMT" 以外のタイムゾーンを設定するには、たとえば +09:00 (JST) の場合

Utilities.formatDate(new Date, 'Etc/GMT-9', "yyyy-MM-dd'T'HH:mm:ss'Z'");

とすればOK。"JST" とか書いてもダメだし、GMT+9 でもダメなので注意。

 
ログイン ユーザー登録
ようこそ ゲスト さん