跳到主要内容

SetCreated

Sets the document creation date.

Syntax

expression.SetCreated(oCreated);

expression - A variable that represents a ApiCore class.

Parameters

NameRequired/OptionalData typeDefaultDescription
oCreatedRequiredDateThe document creation date.

Returns

This method doesn't return any data.

Example

This example demonstrates how to set the creation date of the current document.

const doc = Api.GetDocument();
const core = doc.GetCore();
core.SetCreated(new Date('20 January 2000'));

const createdDate = core.GetCreated().toDateString();
let paragraph = doc.GetElement(0);
paragraph.AddText("Created: " + createdDate);