22 Module function to return a formatted time string. |
22 Module function to return a formatted time string. |
23 |
23 |
24 @param seconds time in seconds since epoch to be formatted (float or long) |
24 @param seconds time in seconds since epoch to be formatted (float or long) |
25 @return formatted time string (string) |
25 @return formatted time string (string) |
26 """ |
26 """ |
27 return QDateTime.fromTime_t(int(seconds))\ |
27 return ( |
28 .toTimeSpec(Qt.LocalTime)\ |
28 QDateTime.fromTime_t(int(seconds)) |
29 .toString("yyyy-MM-dd hh:mm:ss") |
29 .toTimeSpec(Qt.LocalTime) |
|
30 .toString("yyyy-MM-dd hh:mm:ss") |
|
31 ) |
30 |
32 |
31 |
33 |
32 def dateFromTime_t(seconds): |
34 def dateFromTime_t(seconds): |
33 """ |
35 """ |
34 Module function to return the date. |
36 Module function to return the date. |