Date Conversion Functions

Details of the following date conversion functions are available.

DayOfWeek Function

DayOfWeek(<eventAttribute>) returns the day of week in the DATE valued <eventAttribute>. 0 is returned for Sunday and 6 for Saturday.

Syntax

DayOfWeek (<eventAttribute>)

  • <eventAttribute> type must be DATE
  • Returned values are
    • 0 for Sunday
    • 1 for Monday
    • 2 for Tuesday
    • 3 for Wednesday
    • 4 for Thursday
    • 5 for Friday
    • 6 for Saturday

Scope

  • DayOfWeek() is available in EventDB, ClickHouse and Elasticsearch queries and rules.
  • DayOfWeek() can be used in Filter and Group By.

Example

phEventRecvTime

eventType

DayOfWeek(phEventRecvTime)

Monday May 15, 10:37AM

Login-Success

1

Tuesday May 16, 7:37AM

Login-Success

2

HourOfDay Function

HourOfDay (<field>) returns the hour of day in the DATE valued argument. For times between 12:00AM and 12:59AM, HourOfDay() returns 0; between 1:00AM and 1:59AM, HourOfDay() returns 1, etc.

Syntax

HourOfDay (<eventAttribute>) and eventAttribute type must be DATE.

Scope

HourOfDay() is available in EventDB, ClickHouse and Elasticsearch.

Example

phEventRecvTime

eventType

HourOfDay(phEventRecvTime)

Monday May 15, 10:37AM

Login-Success

10

Monday May 15, 7:37AM

Login-Success

7