?Date_Format(date()) ?Date_Format(date(), [dddd', 'dd MMM yyyy]) For other formats, see http://msdn2.microsoft.com/en-us/library/ms776293.aspx You may want to force the locale *-------------------------------------------------------------------------- function Date_Format(d, lpFormat) #define DATE_SHORTDATE 0x00000001 #define DATE_LONGDATE 0x00000002 #define LOCALE_SYSTEM_DEFAULT 0x00000800 #define LOCALE_USER_DEFAULT 0x00000400 * LCID GetThreadLocale(void) declare long GetThreadLocale in win32api *int GetDateFormat( * LCID Locale, // locale * DWORD dwFlags, // options * CONST SYSTEMTIME *lpDate, // date * LPCTSTR lpFormat, // date format * LPTSTR lpDateStr, // formatted string buffer * int cchDate // size of buffer *); declare integer GetDateFormat in win32api ; long Locale, ; long dwFlags, ; string@ lpDate, ; String@ lpFormat, ; string@ lpDateStr, ; integer cchDate local lpDate, lpFormat, DateFormatted, nchars lpDate = SystemTimeStruct(m.d) DateFormatted = space(128) do case case !inlist(vartype(m.d), T_DATE, T_DATETIME ) assert FALSE return '' endcase lpFormat = iif(empty(m.lpFormat), [ddd', 'dd MMM yyyy], m.lpFormat) nchars = GetDateFormat( GetThreadLocale(), 0, @m.lpDate, @m.lpFormat, @m.DateFormatted, len(m.DateFormatted)) && GERMAN: nchars = GetDateFormat( 0x0407, 0, @m.lpDate, @m.lpFormat, @m.DateFormatted, len(m.DateFormatted)) && ENGLISH: nchars = GetDateFormat( 0x0409, 0, @m.lpDate, @m.lpFormat, @m.DateFormatted, len(m.DateFormatted)) && see : http://msdn2.microsoft.com/en-us/library/ms776260.aspx do case case empty(m.nchars) return '' case inlist(vartype(d), T_DATE) return left(m.DateFormatted, m.nchars-1) case inlist(vartype(d), T_DATETIME ) return left(m.DateFormatted, m.nchars-1) + ' ' + ttoc(m.d,2) endcase endfunc *--------------------------------------------------------------------------- function SystemTimeStruct(d) local s do case case inlist(vartype(m.d), T_DATE, T_DATETIME ) s = BinToWord(year(m.d)) ; + BinToWord(Month(m.d)) ; + BinToWord(mod(dow(m.d,2),7)) ; + BinToWord(day(m.d)) ; + BinToWord(hour(m.d)) ; + BinToWord(minute(m.d)) ; + BinToWord(sec(m.d)) ; + BinToWord(0) case vartype(m.d) == 'X' && null s = BinToWord(0) ; + BinToWord(0) ; + BinToWord(0) ; + BinToWord(0) ; + BinToWord(0) ; + BinToWord(0) ; + BinToWord(0) ; + BinToWord(0) otherwise assert FALSE s = '' endcase return m.s endfunc *--------------------------------------------------------------------------- function BinToWord(x) x = int(m.x) return chr(bitand(m.x, 0xff)) + ; chr(bitand(bitrshift(m.x, 8), 0xff)) endfunc *----------------------------------------------------------------------------