Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

FwDateTimeToLocal

FwDateTimeToLocal(cDateTime, [nVerao]) --> aDateTime

Converts a timestamp string to local date/time.

FwDateTimeToLocalAdvPL
01 · OVERVIEW

Overview

Accepts W3C ISO 8601/RFC 3339 formats and returns local date/time in two positions. Z or an offset contributes to the instant; do not merely strip it. nVerao accepts 1/0; defaults depend on MV_HVERAO in an open environment. The example explicitly uses zero without promising a fixed time in an unknown timezone. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

FwDateTimeToLocal(cDateTime, [nVerao]) --> aDateTime

Parameters

cDateTime
CharacterRequired

Accepted timestamp text.

nVerao
NumericOptional

1 with daylight saving, 0 without.

Return value

[1] date; [2] time text.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed415()
    Local aLocal := FwDateTimeToLocal("2026-10-26T12:00:00Z",0)
    // Environment timezone determines conversion.
    ConOut(cValToChar(Len(aLocal)))
Return Nil
Expected result

Two-element array with environment-local date and time. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check context and return before integration; the example does not replace a complete routine.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. FwDateTimeToLocal. 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