Skip to content

Commit

Permalink
renames basics to validating, inits real basics
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Hausenblas <hausenbl@amazon.com>
  • Loading branch information
mhausenblas committed May 12, 2020
1 parent fed2e8e commit 6428b4f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Expand Up @@ -4,6 +4,35 @@ OPA's Rego has a number of built-in functions, ranging from string manipulation

## Basics

```
now := time.now_ns()
```

```
ts := time.parse_rfc3339_ns("2020-04-03T02:01:00Z")
```

```
[year, month, day] := time.date(ts)
```

```
[hour, minute, second]:= time.clock(ts)
```

```
day := time.weekday(ts)
```

```
y := 0
m := 1
d := 0
one_month_in_the_future := time.add_date(now, y, m, d)
```

## Validating time window

Let's assume we have input data in the following form:

```json
Expand Down

0 comments on commit 6428b4f

Please sign in to comment.