Revision 3386e7a9 lib/cli.py
b/lib/cli.py | ||
---|---|---|
47 | 47 |
"USEUNITS_OPT", "FIELDS_OPT", "FORCE_OPT", "SUBMIT_OPT", |
48 | 48 |
"ListTags", "AddTags", "RemoveTags", "TAG_SRC_OPT", |
49 | 49 |
"FormatError", "SplitNodeOption", "SubmitOrSend", |
50 |
"JobSubmittedException", |
|
50 |
"JobSubmittedException", "FormatTimestamp",
|
|
51 | 51 |
] |
52 | 52 |
|
53 | 53 |
|
... | ... | |
689 | 689 |
result.append(format % tuple(args)) |
690 | 690 |
|
691 | 691 |
return result |
692 |
|
|
693 |
|
|
694 |
def FormatTimestamp(ts): |
|
695 |
"""Formats a given timestamp. |
|
696 |
|
|
697 |
@type ts: timestamp |
|
698 |
@param ts: a timeval-type timestamp, a tuple of seconds and microseconds |
|
699 |
|
|
700 |
@rtype: string |
|
701 |
@returns: a string with the formatted timestamp |
|
702 |
|
|
703 |
""" |
|
704 |
sec, usec = ts |
|
705 |
return time.strftime("%F %T", time.localtime(sec)) + ".%06d" % usec |
Also available in: Unified diff