Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

Seconds

Seconds() -> nSeconds

Returns seconds elapsed since midnight.

SecondsAdvPL
01 · OVERVIEW

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.)

02 · SYNTAX

Syntax

Seconds() -> nSeconds

Return value

Numeric: seconds of current day.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed643()
    // Time of day; not a unique identifier.
    Local nNow := Seconds()
    ConOut(nNow)
Return Nil
Expected result

Value 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.

BEST PRACTICES
  • 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.

Related content

REFERENCES
  1. TOTVS. Seconds. TDN. Accessed on 2026-10-28.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha