ITextWriter.WriteLnDateTime

Syntax

WriteLnDateTime(Value: DateTime);

Parameters

Value. Dates or time values that must be written.

Description

The WriteLnDateTime method writes variables of the DateTime type into a text file with further cursor move to the next string.

Example

Sub UserProc;
Var
    f: IFileStream;
    TxtWriter: ITextWriter;
    d: DateTime;
Begin
    f := New FileStream.Create("c:\File.txt", FileOpenMode.Create, FileShare.Exclusive);
    TxtWriter := New TextWriter.Create(f);
    d := DateTime.Now;
    TxtWriter.WriteString("Created:");
    TxtWriter.WriteLnDateTime(d);
    TxtWriter.WriteString("MustBeRemoved:");
    TxtWriter.WriteLnDateTime(DateTime.AddYears(d, 1));
    TxtWriter.Flush;
    Dispose f;
End Sub UserProc;

On executing the example a new text file File.txt is created. Two strings are written to the file. The first string contains the date of file creation and the second contains the date when the file must be deleted.

Creation date and time.

See also:

ITextWriter