Type/to search
Built-in Functions
Global
Version
IsVirtual
GetOS
GetPid
GetMeta
Sleep
Unix
UnixNano
_D
GetCommand
GetLastError
SetErrorFilter
_N
_C
_Cross
JSON.parse
JSON.stringify
Encode
MD5
UUID
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

Get the nanosecond-level timestamp of the current moment.

UnixNano()

Examples

If you need to get a millisecond-level timestamp, you can use the following code.

javascript
function main() { var time = UnixNano() / 1000000 Log(_N(time, 0)) }
python
def main(): time = UnixNano() // 1000000 Log(time)
rust
fn main() { let time = UnixNano() / 1000000; Log!(_N(time, 0)); }

Returns

TypeDescription

number

Nanosecond-level timestamp.

See Also