Post by Andrew Conroy Post by Andrew Conroy Post by Harriet Bazley
On 25 Jun 2019 as I do recall,
Post by Kevin Wells
How can you get the month as a number instead of the 3 letter
shorterned name e.g?
06 instread of Jun
Use OS_Word 14 to read the computer's clock as a 5-byte time value,
then pass the resulting area of memory to OS_ConvertDateAndTime.
The format string for a three-letter shortened month name is %M3 and
for the month in numbers is %MN - see manuals.
Or OS_ConvertDateAndTime or, better still,
Territory_ConvertTimeToOrdinals to convert any 5 byte time block rather
than just the current time. You'll then have to parse the result to get
just the month.
There's also Territory_TimeStringToOrdinals which might be easier. Feed
in a dummy time string with the desired month in it, and back comes the
month number at offset &14 in the buffer.
DIM wlib_block% 256
IF LEN(format$) > 127 THEN format$=LEFT$(format$,127)
SYS "Territory_ConvertDateAndTime",-1,localtime%,result%,rsize%,format$ TO
REM SYS "OS_ConvertDateAndTime",localtime%,result%,rsize%,format$ TO
For your case:
will return the current 3-letter month.
Alan Adams, from Northamptonshire