dDataDate to extract the day from.
AdvPL GuideDay( <dData> ) --> nDiaExtracts the day of the month from a date.
Day accepts a date and returns an integer from zero to 31. The reference documents zero for blank or invalid dates. This differs from CDow, which returns the weekday name. The example uses SToD to avoid day/month ambiguity and handles the transition beyond month end. (TOTVS, n.d., ref. 1)
Day( <dData> ) --> nDiadDataDate to extract the day from.
Integer from 0 to 31 according to the date.
#Include "Protheus.ch"
User Function Ed322()
Local dReference := SToD("20261031")
// Adding a day changes the month before day extraction.
ConOut(cValToChar(Day(dReference)))
ConOut(cValToChar(Day(dReference + 1)))
Return NilExpected results: 31 and 1. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.