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 this: Wed, DD-Mon-YYYY HH:MM:SS GMT
(t=None)
| 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. |
| 115 | |
| 116 | If the function is called without an argument, it will use the current |
| 117 | time. |
| 118 | |
| 119 | The format of the returned string is like this: |
| 120 | |
| 121 | Wed, DD-Mon-YYYY HH:MM:SS GMT |
| 122 | |
| 123 | """ |
| 124 | if t is None: |
| 125 | dt = datetime.datetime.now(tz=datetime.UTC) |
| 126 | else: |
| 127 | dt = datetime.datetime.fromtimestamp(t, tz=datetime.UTC) |
| 128 | return "%s, %02d-%s-%04d %02d:%02d:%02d GMT" % ( |
| 129 | DAYS[dt.weekday()], dt.day, MONTHS[dt.month-1], |
| 130 | dt.year, dt.hour, dt.minute, dt.second) |
| 131 | |
| 132 | |
| 133 | UTC_ZONES = {"GMT": None, "UTC": None, "UT": None, "Z": None} |
searching dependent graphs…