日時型をTEXT関数で変換すると GTM表示されます。
しかしDATEVALUE関数はGTMでなくローカルタイムゾーンで評価されるようです。
上は日時型をDATEVALUEで変換したもの
下は日時型をTEXTで変換したもの
IF( IsAcquiredDuringDaylightSavings__c,
AND(
WEEKDAY(DATEVALUE(AcquisitionDatetime__c )) != 1,
WEEKDAY(DATEVALUE(AcquisitionDatetime__c )) != 7,
TIMEVALUE(AcquisitionDatetime__c + (11 / 24)) >= TIMEVALUE("08:30:00.000"),
TIMEVALUE(AcquisitionDatetime__c + (11 / 24)) <= TIMEVALUE("17:30:00.000")
),
AND(
WEEKDAY(DATEVALUE(AcquisitionDatetime__c )) <> 1,
WEEKDAY(DATEVALUE(AcquisitionDatetime__c )) <> 7,
TIMEVALUE(AcquisitionDatetime__c + (10 / 24)) >= TIMEVALUE("08:30:00.000"),
TIMEVALUE(AcquisitionDatetime__c + (10 / 24)) <= TIMEVALUE("17:30:00.000")
)
)
Acquired during business hours formula
DATETIMEVALUEを使った時の時間(ローカル? GMT?)
普通に日付フィールドにした場合はちゃんと日本時間
TEXT(datetime_1__c) + ":" + TEXT(datetime_2__c) + ":" + TEXT(datetime_1__c - datetime_1__c)
2022-07-09 03:15:00Z:2022-07-08 03:00:00Z:1.01041666666666666666666666666666666667
DATETIMEVALUEを使ったらGMTになっていますねぇ。
TEXT(datetime_1__c) + ":" + TEXT(DATETIMEVALUE("2022-07-08 12:00:30")) + ":" + TEXT(datetime_1__c - DATETIMEVALUE("2022-07-08 12:00:30") )
2022-07-09 03:15:00Z:2022-07-08 12:00:30Z:.635069444444444444444444444444444444444
もしかして、+09:00が必要かな。
TEXT(datetime_1__c) + ":" + TEXT(DATETIMEVALUE("2022-07-08T12:00:30+09:00")) + ":" + TEXT(datetime_1__c - DATETIMEVALUE("2022-07-08T12:00:30+09:00") )
これでは何も表示されません。
TEXT(datetime_1__c) + ":" + TEXT(DATETIMEVALUE("2022-07-08 12:00:30+09:00")) + ":" + TEXT(datetime_1__c - DATETIMEVALUE("2022-07-08 12:00:30+09:00") )
Looks like there's a problem.
Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details.
ui.services.connection.api.PartnerConnectionException: UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 772115904-244412 (1814626073)