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