Welcome Guest, you are in: Login

Fruit Of The Shed

Navigation (MMBasic)






Search the wiki

»


Day of the Week from DATE$ as day name

Modified on 2018/01/31 13:05 by CaptainBoing Categorized as Dates, Time and Clocks
A small wrapper function for Quazee137's tiny Day Of The week function. Takes a date string as dd-mm-yyyy e.g. that returned by DATE$ or LEFT$(Humantime$(x,0),10) and returns the day name.

Beware the date format must be dd-mm-yyyy, no error checking is performed.


Syntax:
DoWDay$(date_str$)

Example Usage:
Day$=DoWDay$("20-08-1995")

Dependencies:

	Function DoWDay$(dd$)
		Select Case DayOfWeek(val(mid$(dd$,7,4)),val(mid$(dd$,4,2)),val(left$(dd$,2)))
			Case 0:DoWDay$="Sun"
			Case 1:DoWDay$="Mon"
			Case 2:DoWDay$="Tue"
			Case 3:DoWDay$="Wed"
			Case 4:DoWDay$="Thu"
			Case 5:DoWDay$="Fri"
			Case 6:DoWDay$="Sat"
		End Select
	End Function