Skip to content

Commit beec3ad

Browse files
committed
docs: update docs
1 parent b1d6ff2 commit beec3ad

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

docs/utilities/feature_flags.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ Use cases:
473473

474474
=== "features.json"
475475

476-
```json hl_lines="15 19-21"
476+
```json hl_lines="15 19-27"
477477
--8<-- "examples/feature_flags/src/timebased_features.json"
478478
```
479479

@@ -487,10 +487,18 @@ You can also have features enabled only at certain times of the day.
487487

488488
=== "features.json"
489489

490-
```json hl_lines="9-14"
490+
```json hl_lines="9-15"
491491
--8<-- "examples/feature_flags/src/timebased_happyhour_features.json"
492492
```
493493

494+
???+ info "How should I use timezones?"
495+
You can use any [IANA time zone](https://www.iana.org/time-zones) (as originally specified
496+
in [PEP 615](https://peps.python.org/pep-0615/)) as part of your rules definition.
497+
Powertools takes care of converting and calculate the correct timestamps for you.
498+
499+
When using `SCHEDULE_BETWEEN_DATETIME_RANGE`, use timestamps without timezone information, and
500+
specify the timezone manually. This way, you'll avoid hitting problems with day light savings.
501+
494502
## Advanced
495503

496504
### Adjusting in-memory cache
@@ -649,11 +657,13 @@ The `action` configuration can have the following values, where the expressions
649657

650658
For time based keys, we provide a list of predefined keys. These will automatically get converted to the corresponding timestamp on each invocation of your Lambda function.
651659

652-
| Key | Meaning (always in UTC) |
660+
| Key | Meaning |
653661
|-------------------------|--------------------------------------------------------------------------|
654-
| CURRENT_TIME_UTC | The current time, 24 hour format (HH:mm) |
655-
| CURRENT_DATETIME_UTC | The current datetime ([ISO8601](https://en.wikipedia.org/wiki/ISO_8601)) |
656-
| CURRENT_DAY_OF_WEEK_UTC | The current day of the week (Monday-Sunday) |
662+
| CURRENT_TIME | The current time, 24 hour format (HH:mm) |
663+
| CURRENT_DATETIME | The current datetime ([ISO8601](https://en.wikipedia.org/wiki/ISO_8601)) |
664+
| CURRENT_DAY_OF_WEEK | The current day of the week (Monday-Sunday) |
665+
666+
If not specified, the timezone used for calculations will be UTC.
657667

658668
**For multiple conditions**, we will evaluate the list of conditions as a logical `AND`, so all conditions needs to match to return `when_match` value.
659669

0 commit comments

Comments
 (0)