Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

CMonth

CMonth( <dData> ) --> cRet

Returns the month name in English.

CMonthAdvPL
01 · OVERVIEW

Overview

CMonth accepts a date and returns its month name in English with an uppercase initial. Output does not automatically follow system or page language. A blank or invalid date produces an empty string according to documentation. The example uses SToD to avoid configured date-input formats. Do not translate expected output just because comments are localized. (TOTVS, n.d., ref. 1)

02 · SYNTAX

Syntax

CMonth( <dData> ) --> cRet

Parameters

dData
DateRequired

Reference date.

Return value

Character string in English.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed303()
    // Fixed unambiguous date for review.
    ConOut(CMonth(SToD("20261026")))
Return Nil
Expected result

Expected result: October. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Validate date type and define interface localization separately.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. CMonth. TDN. Accessed on 2026-10-26.
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