Usina BRAdvPL Guide
Sign in
← All topics
COMMANDUnder review

SET DATE

SET DATE [TO] cDateFormat

Sets the date display format.

SET DATEAdvPL
01 · OVERVIEW

Overview

SET DATE TO BRITISH is a historical command form. The example uses Set with an explicit mask and restores the previous value. It does not change the system date or disambiguate two-digit years; _SET_EPOCH is separate. Integration formats belong in the contract rather than display settings. (Sources: refs. 1–2.)

02 · SYNTAX

Syntax

SET DATE [TO] cDateFormat
03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"
#Include "set.ch"

User Function Ed651()
    Local xPrevious
    // Preserve state so the caller retains its original behavior.
    xPrevious := Set(_SET_DATEFORMAT,"dd/mm/yyyy")
    ConOut(cValToChar(Set(_SET_DATEFORMAT)))
    Set(_SET_DATEFORMAT,xPrevious)
Return Nil
Expected result

Displays the temporary setting and restores the original on normal completion. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Ensure restoration on error exits as well. Use constants from installed set.ch instead of magic numbers.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Set: parâmetros e valores anteriores. Accessed on 2026-10-28.
  2. Guia de referência eAdvPL. §1.1–1.2, sintaxe histórica. 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