Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31f7f41

Browse files
authored
Update the timestamp to default to UTC. (tensorflow#4040)
Previously the timestamp we pushed to bigquery was PDT, but the timezone spec was set to 'Z' (UTC). This is provide incorrect value to bigquery, and might affect analysis down the road.
1 parent 40093e1 commit 31f7f41

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

official/utils/logs/logger.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def log_metric(self, name, value, unit=None, global_step=None, extras=None):
149149
"value": float(value),
150150
"unit": unit,
151151
"global_step": global_step,
152-
"timestamp": datetime.datetime.now().strftime(
152+
"timestamp": datetime.datetime.utcnow().strftime(
153153
_DATE_TIME_FORMAT_PATTERN),
154154
"extras": extras}
155155
try:
@@ -184,7 +184,8 @@ def _gather_run_info(model_name):
184184
run_info = {
185185
"model_name": model_name,
186186
"machine_config": {},
187-
"run_date": datetime.datetime.now().strftime(_DATE_TIME_FORMAT_PATTERN)}
187+
"run_date": datetime.datetime.utcnow().strftime(
188+
_DATE_TIME_FORMAT_PATTERN)}
188189
_collect_tensorflow_info(run_info)
189190
_collect_tensorflow_environment_variables(run_info)
190191
_collect_cpu_info(run_info)

0 commit comments

Comments
 (0)