Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » system facilities » currentTime
next | previous | forward | backward | up | index | toc

# currentTime -- get the current time

- Usage:
    `currentTime()`
- Outputs:
  - an integer, the current time, in seconds since 00:00:00 1970-01-01 UTC, the beginning of the epoch

## Description

    i1 : currentTime()

    o1 = 1770552280

We can compute, roughly, how many years ago the epoch began as follows.

    i2 : currentTime() /( (365 + 97./400) * 24 * 60 * 60 )

    o2 = 56.10656821355878

    o2 : RR (of precision 53)

We can also compute how many months account for the fractional part of that number.

    i3 : 12 * (oo - floor oo)

    o3 = 1.278818562705368

    o3 : RR (of precision 53)

Compare that to the current date, available from a standard Unix command.

    i4 : run "date"
    Sun Feb  8 12:04:40 UTC 2026

    o4 = 0

## For the programmer

The object currentTime is a compiled function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_system.m2:1849:0.