Skip to content

Time related primitives

bfe_time_range(start_time, end_time)

  • Description: Judge if current time is in [start_time, end_time]

  • Parameters

Parameter Description
start_time String
start time
end_time String
end time

Time format:yyyymmddhhmmssZ,Z is time zone,detail information is shown in Section "Time Zone Detail"

  • Example
bfe_time_range("20190204203000H", "20190204204500H")

bfe_periodic_time_range(start_time, end_time, period)

  • Description: Judge if current time is periodly(period) in [start_time, end_time]

  • Parameters

Parameter Description
start_time String
start time
end_time String
end time
period String
period, defualt Day

Time format: hhmmssZ,Z is time zone,detail information is shown in "Appendix B: Time Zone Detail"

  • Example
bfe_periodic_time_range("203000H", "204500H", "")

Appendix A: Condition Primitive Test

  • In order to test time condition primitive, X-Bfe-Debug-Time can be added in header of request to mock system time

Appendix B: Time Zone Detail

Time zone name Letter Offset Description
Alfa Time Zone A +1
Bravo Time Zone B +2
Charlie Time Zone C +3
Delta Time Zone D +4
Echo Time Zone E +5
Foxtrot Time Zone F +6
Golf Time Zone G +7
Hotel Time Zone H +8 Beijing Time
India Time Zone I +9
Kilo Time Zone K +10
Lima Time Zone L +11
Mike Time Zone M +12
November Time Zone N −1
Oscar Time Zone O −2
Papa Time Zone P −3
Quebec Time Zone Q −4
Romeo Time Zone R −5
Sierra Time Zone S −6
Tango Time Zone T −7
Uniform Time Zone U −8
Victor Time Zone V −9
Whiskey Time Zone W −10
X-ray Time Zone X −11
Yankee Time Zone Y −12
Zulu Time Zone Z 0 Greenwich Mean Time