LoginSignup
2
0

More than 3 years have passed since last update.

[ServiceNow]DateTimeのgetValueとgetDisplayValueの違い

Last updated at Posted at 2020-12-26

日付・時刻をスクリプト内で使用する際はちょっと気を付けないといけない話

getValueとgetDisplayValue

getValueで取得できるのは、システムのTimezoneを変更していてもUTCのタイムゾーンで値を取得する。
getDisplayValueでは、ユーザのタイムゾーンで値を取得する。

『プロパティ』
image.png

『ユーザ言語』
image.png

image.png

image.png

時差によって、日付が変わったりするので気を付けないといけないですね。

ちなみに・・
image.png
image.png

GlideDateの場合だと、getValue、getDisplayValueどちらもUTCでとれるので、0時に動くバッチとかでGlideDateを使用するときは注意が必要。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0