Here's a (rather klunky) function that emulates (for the most part) most of strftime() from C. It's only been lightly tested so may contain bugs still, however is being used in a program of mine so if any appear I'll edit and post the fixes.
I was using an actual strftime() call using INLINE, but kept getting occasional, semi-random crashes on start-up that I never successfully tracked down, so I thought I'd make this function instead -- with the added bonus that at least this one is/should be cross-platform.
// Example
PRINT Time$("Time: %h:%M%p"), 100, 200
SHOWSCREEN
MOUSEWAIT
// Return a time/date string based upon given format:
// %b: Abbreviated month name
// %B: Full month name
// %d: Day of the month (01-31)
// %H: Hour in 24-hour format
// %h: Hour in 12-hour format
// %m: Month (01-12)
// %M: Minute (00-59)
// %p: AM or PM
// %S: Second (00-59)
// %y: Year without century
// %Y: Year with century
// %%: Percent sign
FUNCTION Time$: fstring$
LOCAL output$, td$[], pos%, temp%
// Abbreviated month names
DIMDATA amonth$[], "NIL", "Jan.", "Feb.", "Mar.", "Apr.", "May", _
"June", "July", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."
// FUll month names
DIMDATA fmonth$[], "NIL", "January", "February", "March", "April", _
"May", "June", "July", "August", "September", "October", _
"November", "December"
// Get our local time and date, then split each section into an array
SPLITSTR(PLATFORMINFO$("TIME"), td$[], ":- ")
// Process our format string
pos% = 0
WHILE pos% < LEN(fstring$)
// Have we found a control character?
IF MID$(fstring$, pos%, 1) = "%"
pos% = pos% + 1
SELECT MID$(fstring$, pos%, 1)
// Abbreviated month name
CASE "b"
temp% = td$[1]
output$ = output$ + amonth$[temp%]
// Full month name
CASE "B"
temp% = td$[1]
output$ = output$ + fmonth$[temp%]
// Day of the month (01-31)
CASE "d"
output$ = output$ + td$[2]
// Hour in 24-hour format
CASE "H"
output$ = output$ + td$[3]
// Hour in 12-hour format
CASE "h"
// Convert from 24 hour time to 12 hour time
IF td$[3] > 12
temp% = td$[3]
output$ = output$ + (temp% - 12)
// 12 midnight
ELSEIF td$[3] = 0
output$ = output$ + "12"
// Handle all other instances
ELSE
output$ = output$ + td$[3]
ENDIF
// Month (01-12)
CASE "m"
output$ = output$ + td$[1]
// Minute (00-59)
CASE "M"
output$ = output$ + td$[4]
// AM or PM
CASE "p"
IF td$[3] >= 12
output$ = output$ + "PM"
ELSE
output$ = output$ + "AM"
ENDIF
// Second (00-59)
CASE "S"
output$ = output$ + td$[5]
// Year without century
CASE "y"
output$ = output$ + MID$(td$[0], 2, -1)
// Year with century
CASE "Y"
output$ = output$ + td$[0]
// Percent sign
CASE "%"
output$ = output$ + "%"
// Unrecognised format character, just copy it over
DEFAULT
output$ = output$ + MID$(fstring$, pos%, 1)
ENDSELECT
pos% = pos% + 1
// No control character, just copy it across
ELSE
output$ = output$ + MID$(fstring$, pos%, 1)
pos% = pos% + 1
ENDIF
WEND
RETURN output$
ENDFUNCTION