Returns (timestamp, the_date, the_time)
()
| 52 | |
| 53 | |
| 54 | def get_master_time(): |
| 55 | """Returns (timestamp, the_date, the_time)""" |
| 56 | import datetime |
| 57 | |
| 58 | timestamp = str(int(time.time())) + " (Unix Timestamp)" |
| 59 | now = datetime.datetime.now() |
| 60 | utc_offset = -time.timezone / 3600.0 |
| 61 | utc_offset += time.daylight |
| 62 | utc_str = "UTC+0" |
| 63 | if utc_offset > 0: |
| 64 | if utc_offset < 10: |
| 65 | utc_str = "UTC+0%s" % utc_offset |
| 66 | else: |
| 67 | utc_str = "UTC+%s" % utc_offset |
| 68 | elif utc_offset < 0: |
| 69 | if utc_offset > -10: |
| 70 | utc_str = "UTC-0%s" % abs(utc_offset) |
| 71 | else: |
| 72 | utc_str = "UTC-%s" % abs(utc_offset) |
| 73 | utc_str = utc_str.replace(".5", ".3").replace(".", ":") + "0" |
| 74 | time_zone = "" |
| 75 | try: |
| 76 | time_zone = "(" + time.tzname[time.daylight] + ", " + utc_str + ")" |
| 77 | except Exception: |
| 78 | time_zone = "(" + utc_str + ")" |
| 79 | # Use [Day-of-Week, Month Day, Year] format when time zone < GMT/UTC-3 |
| 80 | the_date = now.strftime("%A, %B %d, %Y").replace(" 0", " ") |
| 81 | if utc_offset >= -3: |
| 82 | # Use [Day-of-Week, Day Month Year] format when time zone >= GMT/UTC-3 |
| 83 | the_date = now.strftime("%A, %d %B %Y").replace(" 0", " ") |
| 84 | the_time = now.strftime("%I:%M:%S %p ") + time_zone |
| 85 | if the_time.startswith("0"): |
| 86 | the_time = the_time[1:] |
| 87 | return timestamp, the_date, the_time |
| 88 | |
| 89 | |
| 90 | def get_browser_version(driver): |
no outgoing calls
no test coverage detected
searching dependent graphs…