Time related primitives

July 31, 2026 · View on GitHub

bfe_time_range(start_time, end_time)

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

  • Parameters

ParameterDescription
start_timeString
start time
end_timeString
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]

    • Note: In the current implementation, the period parameter only supports an empty string, which means daily periodicity. A non-empty value will cause an error.
  • Parameters

ParameterDescription
start_timeString
start time
end_timeString
end time
periodString
period, currently only an empty string is supported (daily periodicity)

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 nameLetterOffsetDescription
Alfa Time ZoneA+1
Bravo Time ZoneB+2
Charlie Time ZoneC+3
Delta Time ZoneD+4
Echo Time ZoneE+5
Foxtrot Time ZoneF+6
Golf Time ZoneG+7
Hotel Time ZoneH+8Beijing Time
India Time ZoneI+9
Kilo Time ZoneK+10
Lima Time ZoneL+11
Mike Time ZoneM+12
November Time ZoneN−1
Oscar Time ZoneO−2
Papa Time ZoneP−3
Quebec Time ZoneQ−4
Romeo Time ZoneR−5
Sierra Time ZoneS−6
Tango Time ZoneT−7
Uniform Time ZoneU−8
Victor Time ZoneV−9
Whiskey Time ZoneW−10
X-ray Time ZoneX−11
Yankee Time ZoneY−12
Zulu Time ZoneZ0Greenwich Mean Time