ShortDateFormatEdit (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This examples demonstrates that you can change the date format by changing this variable.

Code

begin
  { Ask the user to supply a date and place it into ShortDateFormat variable }
  WriteLn('Enter the desired format (ex. dd/mm/yyyy):');
  ReadLn(ShortDateFormat);

  { Write the date on the console using the selected short date format }
  WriteLn('Current date is ', DateToStr(Date()));

Uses