SET DATE
SET DATE [TO] cDateFormatSets the date display format.
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.)
Syntax
SET DATE [TO] cDateFormatCommented 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 NilDisplays 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.
- 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.

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