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.

AM/PM付きの日付に変換する

Posted at

日付型に変換する

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

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

)
+"M"
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?