You guys are trying to hack your way through... why don't you just make a straight call to the Windows API?
Something like this:
Output:
You can even specify different locales if you want. This works in Win95 and up.
Something like this:
;.lib "Kernel32.dll" ;GetDateFormat%(iLocale%, iFlags%, iDate%, iFormat$, oDateBuf*, iSizeBuf%):"GetDateFormatA" date = CreateBank(256) size = GetDateFormat(0, 0, 0, "dddd", date, BankSize(date)) Print BankToString(date, size) Delay 1000 End Function BankToString$(b, size) For i = 0 To size-2 ; (null-terminated) s$ = s$ + Chr$(PeekByte(b,i)) Next Return "Today is "+s$+"." End Function
Output:
Today is Thursday.
You can even specify different locales if you want. This works in Win95 and up.