0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

夏時間を考慮した日付のフォーマット変換

Last updated at Posted at 2022-03-02

Answersで回答する時に使う情報のまとめに戻る

military timeとなっているので24時間表示かと思ったらAM、PM表示の12間表示なんですよね。
私の感覚とは違う。

IF( OR(
SchedStartTime< DATETIMEVALUE(DATE(YEAR(DATEVALUE(SchedStartTime)),3,14)
-(WEEKDAY(DATE(YEAR(DATEVALUE(SchedStartTime)),3,14))-1))+11/24,
SchedStartTime> DATETIMEVALUE(DATE(YEAR(DATEVALUE(SchedStartTime)),11,7)
-(WEEKDAY(DATE(YEAR(DATEVALUE(SchedStartTime)),11,7))-1))+11/24
),
TEXT(
HOUR(TIMEVALUE(SchedStartTime-5/24))
-IF(HOUR(TIMEVALUE(SchedStartTime-5/24))>23,24,0)-
IF(HOUR(TIMEVALUE(SchedStartTime-5/24))
-IF(HOUR(TIMEVALUE(SchedStartTime-5/24))>23,24,0)>12, 12,0))+":"+
LPAD(TEXT(MINUTE( TIMEVALUE(SchedStartTime  ))),2, "0")+
IF(HOUR(TIMEVALUE(SchedStartTime-5/24))
-IF(HOUR(TIMEVALUE(SchedStartTime-5/24))>23,24,0)>11, " P"," A")
,
TEXT(
HOUR(TIMEVALUE(SchedStartTime-4/24))
-IF(HOUR(TIMEVALUE(SchedStartTime-4/24))>23,24,0)-
IF(HOUR(TIMEVALUE(SchedStartTime-4/24))
-IF(HOUR(TIMEVALUE(SchedStartTime-4/24))>23,24,0)>12,12,0))

+":"+
LPAD(TEXT(MINUTE( TIMEVALUE(SchedStartTime ))),2, "0")+
IF(HOUR(TIMEVALUE(SchedStartTime-4/24))
-IF(HOUR(TIMEVALUE(SchedStartTime-4/24))>23,24,0)>11, " P"," A")

)
+"M"

Time Formula is showing military time

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?