MCPcopy Create free account
hub / github.com/ccxt/ccxt / from_unix

Method from_unix

python/ccxt/static_dependencies/msgpack/ext.py:119–127  ·  view source on GitHub ↗

Create a Timestamp from posix timestamp in seconds. :param unix_float: Posix timestamp in seconds. :type unix_float: int or float

(unix_sec)

Source from the content-addressed store, hash-verified

117
118 @staticmethod
119 def from_unix(unix_sec):
120 """Create a Timestamp from posix timestamp in seconds.
121
122 :param unix_float: Posix timestamp in seconds.
123 :type unix_float: int or float
124 """
125 seconds = int(unix_sec // 1)
126 nanoseconds = int((unix_sec % 1) * 10**9)
127 return Timestamp(seconds, nanoseconds)
128
129 def to_unix(self):
130 """Get the timestamp as a floating-point value.

Callers 1

from_datetimeMethod · 0.80

Calls 1

TimestampClass · 0.70

Tested by

no test coverage detected