ShortDateFormatEdit (C++)

From RAD Studio Code Examples
Jump to: navigation, search


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


#pragma argsused
int _tmain(int argc, _TCHAR* argv[])
	/* Ask the user to supply a date and place it into ShortDateFormat variable */
	printf("Enter the desired format (ex. dd/mm/yyyy):");
	scanf("%s", ShortDateFormat);

	/* Write the date on the console using the selected short date format */
	printf("Current date is %s", DateToStr(Date()));

	return 0;