We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ff8c3f commit 5b0b103Copy full SHA for 5b0b103
1 file changed
pycatfile/pyfile.py
@@ -1072,6 +1072,14 @@ def format_ns_utc(ts_ns, fmt='%Y-%m-%d %H:%M:%S'):
1072
ns_str = "%09d" % ns
1073
return base + "." + ns_str
1074
1075
+def format_ns_local(ts_ns, fmt='%Y-%m-%d %H:%M:%S'):
1076
+ ts_ns = int(ts_ns)
1077
+ sec, ns = divmod(ts_ns, 10**9)
1078
+ dt = datetime.datetime.fromtimestamp(sec).replace(microsecond=ns // 1000)
1079
+ base = dt.strftime(fmt)
1080
+ ns_str = "%09d" % ns
1081
+ return base + "." + ns_str
1082
+
1083
def CheckSumSupport(checkfor, guaranteed=True):
1084
if(guaranteed):
1085
try:
0 commit comments