Hi,
thanks for pointing to the right track.
Yes,
strftime() also works on Windows. But it returns English day and month names here (on Windows 10), not the localized German names.
( On English Windows versions, there is no difference between "English" and "localized".

)
On Linux,
strftime() returns localized German day and month names (tested on Linux Mint 17.3).
This is the code that I needed, maybe it's also useful for someone else (works in ASCII mode and Unicode mode):
Code: Select all
; PB 5.42 LTS
EnableExplicit
Structure tm
tm_sec.l
tm_min.l
tm_hour.l
tm_mday.l
tm_mon.l
tm_year.l
tm_wday.l
tm_yday.l
tm_isdst.l
EndStructure
Procedure.s LocalizedDayName (DayOfWeek.i, short.i=#False)
; in : DayOfWeek: Sunday=0, ..., Saturday=6
; (compliant with PureBasic's DayOfWeek() function)
; short : #True/#False
; out: short or full localized name of given weekday
Protected tm.tm, fmt.i, numBytes.i, buffer$, bufferSize.i=80
If short
fmt = $6125 ; "%a"
Else
fmt = $4125 ; "%A"
EndIf
buffer$ = Space(bufferSize)
tm\tm_wday = DayOfWeek
numBytes = strftime_(@buffer$, bufferSize*SizeOf(Character), @fmt, @tm)
ProcedureReturn PeekS(@buffer$, numBytes, #PB_UTF8|#PB_ByteLength)
EndProcedure
Procedure.s LocalizedMonthName (MonthOfYear.i, short.i=#False)
; in : MonthOfYear: January=1, ..., December=12
; (compliant with PureBasic's Month() function)
; short : #True/#False
; out: short or full localized name of given month
Protected tm.tm, fmt.i, numBytes.i, buffer$, bufferSize.i=80
If short
fmt = $6225 ; "%b"
Else
fmt = $4225 ; "%B"
EndIf
buffer$ = Space(bufferSize)
tm\tm_mon = MonthOfYear - 1
numBytes = strftime_(@buffer$, bufferSize*SizeOf(Character), @fmt, @tm)
ProcedureReturn PeekS(@buffer$, numBytes, #PB_UTF8|#PB_ByteLength)
EndProcedure
; -- Demo
Define i.i
For i = 0 To 6
Debug LocalizedDayName(i)
Next
Debug "--------"
For i = 0 To 6
Debug LocalizedDayName(i, #True)
Next
Debug "========"
For i = 1 To 12
Debug LocalizedMonthName(i)
Next
Debug "--------"
For i = 1 To 12
Debug LocalizedMonthName(i, #True)
Next