Return a string representing time in seconds since epoch, t. If the function is called without an argument, it will use the current time. The format of the returned string is like "YYYY-MM-DD hh:mm:ssZ", representing Universal Time (UTC, aka GMT). An example of this format is:
(t=None)
| 92 | MONTHS_LOWER = [month.lower() for month in MONTHS] |
| 93 | |
| 94 | def time2isoz(t=None): |
| 95 | """Return a string representing time in seconds since epoch, t. |
| 96 | |
| 97 | If the function is called without an argument, it will use the current |
| 98 | time. |
| 99 | |
| 100 | The format of the returned string is like "YYYY-MM-DD hh:mm:ssZ", |
| 101 | representing Universal Time (UTC, aka GMT). An example of this format is: |
| 102 | |
| 103 | 1994-11-24 08:49:37Z |
| 104 | |
| 105 | """ |
| 106 | if t is None: |
| 107 | dt = datetime.datetime.now(tz=datetime.UTC) |
| 108 | else: |
| 109 | dt = datetime.datetime.fromtimestamp(t, tz=datetime.UTC) |
| 110 | return "%04d-%02d-%02d %02d:%02d:%02dZ" % ( |
| 111 | dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second) |
| 112 | |
| 113 | def time2netscape(t=None): |
| 114 | """Return a string representing time in seconds since epoch, t. |
searching dependent graphs…