cedar-policy/cedar-docs

Remove `timestamp` examples

anwarmamat opened this issue · 4 comments

What were you trying to do?
Cedar docs examples used timestamp. We should remove the timestamp because it is not supported.

What is wrong and why?
Cedar currently does not support timestamp. The following example does not work with Cedar.

when {
  context.time.now < timestamp("2022-01-01T10:15:00.021-05:00")
}

What do we need to do to fix this?
Remove the timestamp references.

Can you just make this change and submit it as a PR?

Is there any way to compare the time, or should I just remove that example altogether?

You can replace timestamp("2022-01-01T10:15:00.021-05:00") with unix timestamp.

when {
  context.time.now < 1698841661
}

Thanks! Fixed in PR 59.