TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

GetTime

GetTime() → { number }

Returns the timestamp of the current form.

Parameters:

This method doesn't have any parameters.

Returns:

Type
number

Example

Copy code
builder.CreateFile("pdf");
var oDocument = Api.GetDocument();
var oDateForm = Api.CreateDateForm({"key": "Nowadays", "tip": "Enter current date", "required": true, "placeholder": "Date", "format": "mm.dd.yyyy", "lang": "en-US"});
var oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oDateForm);
oDateForm.SetTime(new Date().getTime());
var nTime = oDateForm.GetTime();
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Date: " + new Date(nTime));
oDocument.Push(oParagraph);
builder.SaveFile("pdf", "GetTime.pdf");
builder.CloseFile();

Resulting document