WriteDateTime(Value: DateTime);
Value. Dates or time values that must be written.
The WriteDateTime method writes variables of the DateTime type into a text file.
Sub UserProc;
Var
f: IFileStream;
TxtWriter: ITextWriter;
Begin
f := New FileStream.Create("c:\File.txt", FileOpenMode.Create, FileShare.Exclusive);
TxtWriter := New TextWriter.Create(f);
TxtWriter.WriteString("Created:");
TxtWriter.WriteDateTime(DateTime.Now);
TxtWriter.Flush;
Dispose f;
End Sub UserProc;
On executing the example a new text file File.txt is created. The date and time are written to the file.
See also: