fix: Using one single function call for utcnow().
Which issue(s) this PR fixes:
The datetime.utcnow() is about to be deprecated in Python3.12. This pr use one single function to wrap the datetime.utcnow() for easy update and fix.
Please be aware this PR does not retire the datetime.utcnow().
Fixes #4240
Do we really need this? a one-liner util looks odd. Might as well change to the newer version directly.
Do we really need this? a one-liner util looks odd. Might as well change to the newer version directly.
I was thinking about to provide a single function as an implementation of the utcnow(). It's easy to maintenance in case if someone create a new PR but using their own favor implementation of utcnow().
The next step is to have a small PR to deprecate the current datetime.utcnow(). But I need to be very careful since some place in our code base will transfer the value of datetime.utcnow() to a string first and change it to a new string value. The is a inexplicitly "assumption" about the length and format of the str(datetime.utcnow()).