When I set datetime.now() to a variable (see example below), the value keeps updating each time the variable is accessed (instead of just setting the value as the time that the variable was initially declared). How do I capture the current time and store it as a variable value without it changing?
It isn’t that printing that variable more than once in a row results in different values, it’s that it shows a different value each time I run the code (which would obviously produce a different result).
Sorry about that. My critical thinking had a wrench in it for a moment.
Recall that .now() is a method whose only job it is to retrieve the datetime properties from the system. The system clock is in milliseconds and like time itself, always going forward. Successive calls are always going to be different.