Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: client/third_party/infra_libs/time_functions/zulu.py

Issue 2013943002: Changing license header, again! (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 5
6 """Provides functions for parsing and outputting Zulu time.""" 6 """Provides functions for parsing and outputting Zulu time."""
7 7
8 import datetime 8 import datetime
9 import pytz 9 import pytz
10 10
11 from infra_libs.time_functions import timestamp 11 from infra_libs.time_functions import timestamp
12 12
13 13
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 print dt 47 print dt
48 48
49 # Convert datetime into UTC. 49 # Convert datetime into UTC.
50 isodate = dt.astimezone(pytz.UTC).isoformat().split('+')[0] 50 isodate = dt.astimezone(pytz.UTC).isoformat().split('+')[0]
51 51
52 # Add fractional seconds if not present. 52 # Add fractional seconds if not present.
53 if '.' not in isodate: 53 if '.' not in isodate:
54 isodate += '.0' 54 isodate += '.0'
55 55
56 return isodate + 'Z' 56 return isodate + 'Z'
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698