}\r
#endif\r
return bRet;\r
-}
\ No newline at end of file
+}\r
+\r
+/**\r
+ * FUNCTION : FormatDateAndTime\r
+ * DESCRIPTION : Generates a displayable string from a CTime object in\r
+ * system short or long format dependant on setting of option\r
+ * as DATE_SHORTDATE or DATE_LONGDATE \r
+ * RETURN : CString containing date/time\r
+ */\r
+CString CAppUtils::FormatDateAndTime( const CTime& cTime, DWORD option, bool bIncludeTime /*=true*/ )\r
+{\r
+ SYSTEMTIME sysTime;\r
+ cTime.GetAsSystemTime( sysTime );\r
+ CString datetime;\r
+\r
+ TCHAR buf[100];\r
+\r
+ GetDateFormat(LOCALE_USER_DEFAULT, option, &sysTime, NULL, buf, \r
+ sizeof(buf)/sizeof(TCHAR)-1);\r
+ datetime = buf;\r
+ if ( bIncludeTime )\r
+ {\r
+ datetime += _T(" ");\r
+ GetTimeFormat(LOCALE_USER_DEFAULT, 0, &sysTime, NULL, buf, sizeof(buf)/sizeof(TCHAR)-1);\r
+ datetime += buf;\r
+ }\r
+ return datetime;\r
+}\r