Skip to content

Commit

Permalink
Update the timestamp to default to UTC. (tensorflow#4040)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
qlzh727 authored Apr 20, 2018
1 parent 40093e1 commit 31f7f41
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions official/utils/logs/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def log_metric(self, name, value, unit=None, global_step=None, extras=None):
"value": float(value),
"unit": unit,
"global_step": global_step,
"timestamp": datetime.datetime.now().strftime(
"timestamp": datetime.datetime.utcnow().strftime(
_DATE_TIME_FORMAT_PATTERN),
"extras": extras}
try:
Expand Down Expand Up @@ -184,7 +184,8 @@ def _gather_run_info(model_name):
run_info = {
"model_name": model_name,
"machine_config": {},
"run_date": datetime.datetime.now().strftime(_DATE_TIME_FORMAT_PATTERN)}
"run_date": datetime.datetime.utcnow().strftime(
_DATE_TIME_FORMAT_PATTERN)}
_collect_tensorflow_info(run_info)
_collect_tensorflow_environment_variables(run_info)
_collect_cpu_info(run_info)
Expand Down

0 comments on commit 31f7f41

Please sign in to comment.