API referenceForms

pdfSetDateTimeFormat

Give a text field Acrobat-standard date/time input

C
BOOL32 __stdcall pdfSetDateTimeFormat(PPDF IPDF, uint32_t TxtField, int32_t Fmt);
Delphi
function pdfSetDateTimeFormat(const IPDF: PPDF; TxtField: Cardinal; Fmt: Integer): LongBool; stdcall;

Purpose. Give a text field Acrobat-standard date/time input formatting via AFDate_FormatEx/AFDate_KeystrokeEx JS actions — the same /AA F//AA K mechanism as pdfSetNumberFormat above.

Description. Only two Fmt values map to a distinct picture string — every other value (including 0) collapses to the same default. Fmt = 1"mm/dd/yyyy"; Fmt = 2"yyyy-mm-dd"; anything else (the else branch, covering 0, negative values, and any value > 2) → "yyyy-mm-dd HH:MM:ss". There is no error path for an unrecognized Fmt — it is treated identically to the default.

Parameters.

ParameterDescription
IPDFDocument handle.
TxtFieldTarget text field handle.
Fmt1 = mm/dd/yyyy, 2 = yyyy-mm-dd, anything else = yyyy-mm-dd HH:MM:ss.

Return value. True if TxtField resolves to a known field; False otherwise.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Forms
Category

Setters

Exported names

pdfSetDateTimeFormat

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.