Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

FWTimeStamp

FWTimeStamp([nType],[dDate],[cTime])

Formats date and time according to the requested timestamp type.

FWTimeStampAdvPL
01 · OVERVIEW

Overview

Types 1 and 2 format date/time; type 3 puts local time into ISO form without converting it to UTC. Types 5 and 6 respectively include timezone and convert to GMT zero; types 4, 5 and 6 consider MV_HVERAO when an environment is open. The official syntax line says NIL, but descriptions and documented use concern a formatted value: the example checks ValType rather than assuming all return types. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

FWTimeStamp([nType],[dDate],[cTime])

Parameters

nType
NumericOptional

Format 1–6; default 1.

dDate
DateOptional

Date to format.

cTime
CharacterOptional

Time; default Time().

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed452()
    Local uStamp := FWTimeStamp(1,SToD("20261027"),"09:30:00")
    // Check type and contents on the target release.
    ConOut(ValType(uStamp))
    ConOut(cValToChar(uStamp))
Return Nil
Expected result

Documented type 1 format: 20261027093000. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Validate timezone and daylight-saving configuration before external timestamp integration.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

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