You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently have built-in functions to convert nanoseconds to year, month, day and hour, minute second (time.date and time.clock respectively.) In some cases, it makes sense to express policies in terms of days of the week. To support this, OPA should include a time.weekday built-in function that takes nanoseconds since epoch and returns the day of the week.
For example:
> time.weekday(time.now_ns())
"Monday"
Add built-in functions is relatively straightforward. Here's an example: db34907.
It should be possible to just convert nanoseconds into a time.Time struct in Go and then call time.Time#Weekday to get the day of the week.
This code can into topdown/time.go
The text was updated successfully, but these errors were encountered:
We currently have built-in functions to convert nanoseconds to year, month, day and hour, minute second (time.date and time.clock respectively.) In some cases, it makes sense to express policies in terms of days of the week. To support this, OPA should include a
time.weekday
built-in function that takes nanoseconds since epoch and returns the day of the week.For example:
Add built-in functions is relatively straightforward. Here's an example: db34907.
It should be possible to just convert nanoseconds into a
time.Time
struct in Go and then calltime.Time#Weekday
to get the day of the week.This code can into topdown/time.go
The text was updated successfully, but these errors were encountered: