Seconds
Seconds() -> nSecondsReturns seconds elapsed since midnight.
Overview
Reads current system time as seconds since midnight. Subtracting readings can become negative across midnight and is affected by clock adjustments. Seconds is therefore not a monotonic timer, unique identifier or complete timestamp. For long jobs, capture date, time and context and choose environment-appropriate timing. (Sources: refs. 1–1.)
Syntax
Seconds() -> nSecondsReturn value
Numeric: seconds of current day.
Commented example
#Include "Protheus.ch"
User Function Ed643()
// Time of day; not a unique identifier.
Local nNow := Seconds()
ConOut(nNow)
Return NilValue depends on the system clock at execution time. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Adding 86,400 does not solve clock adjustments or measurements exceeding one day.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.