Skip to content

Commit

Permalink
Reset system time constant between expression evaluations
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rl committed Jul 12, 2024
1 parent de880c3 commit 83f8dd6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fhirpathpy/engine/invocations/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ class SystemTime:
expression. It remains the same for the entire expression evaluation.
"""

expressionExecutionDateTime = datetime.now()
def __init__(self) -> None:
self.expressionExecutionDateTime = datetime.now()

def now(self):
return self.expressionExecutionDateTime

def reset(self):
self.expressionExecutionDateTime = datetime.now()


class Constants:
"""
Expand All @@ -30,6 +34,7 @@ def reset(self):
self.now = None
self.timeOfDay = None
self.localTimezoneOffset = None
systemtime.reset()


constants = Constants()
Expand Down

0 comments on commit 83f8dd6

Please sign in to comment.