+5
-1
lines changedFilter options
+5
-1
lines changed Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ function s:msgpack_init_python() abort
56
56
\. " time = datetime.datetime.fromtimestamp(timestamp)\n"
57
57
\. " return time.strftime(fmt)\n"
58
58
\. "def shada_dict_strptime():\n"
59
+
\. " import calendar\n"
59
60
\. " import datetime\n"
60
61
\. " import vim\n"
61
62
\. " fmt = vim.eval('a:format')\n"
@@ -64,7 +65,10 @@ function s:msgpack_init_python() abort
64
65
\. " try:\n"
65
66
\. " timestamp = int(timestamp.timestamp())\n"
66
67
\. " except:\n"
67
-
\. " timestamp = int(timestamp.strftime('%s'))\n"
68
+
\. " try:\n"
69
+
\. " timestamp = int(timestamp.strftime('%s'))\n"
70
+
\. " except:\n"
71
+
\. " timestamp = calendar.timegm(timestamp.utctimetuple())\n"
68
72
\. " if timestamp > 2 ** 31:\n"
69
73
\. " tsabs = abs(timestamp)\n"
70
74
\. " return ('{\"_TYPE\": v:msgpack_types.integer,'\n"
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4