Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
28
Task/Date-format/Yabasic/date-format.basic
Normal file
28
Task/Date-format/Yabasic/date-format.basic
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
dim n$(1)
|
||||
|
||||
n = token(date$, n$(), "-")
|
||||
|
||||
print n$(4), "-", n$(2), "-", n$(3)
|
||||
print nDay$(n$(5)), ", ", nMonth$(n$(6)), " ", n$(3), ", ", n$(4)
|
||||
|
||||
sub nDay$(n$)
|
||||
switch n$
|
||||
case "Mon": case "Fri": case "Sun": break
|
||||
case "Tue": n$ = n$ + "s" : break
|
||||
case "Wed": n$ = n$ + "nes" : break
|
||||
case "Thu": n$ = n$ + "rs" : break
|
||||
case "Sat": n$ = n$ + "ur" : break
|
||||
default: n$ = "none" : break
|
||||
end switch
|
||||
|
||||
return n$ + "day"
|
||||
end sub
|
||||
|
||||
sub nMonth$(n$)
|
||||
local month$(1), n
|
||||
|
||||
n = token("January, February, March, April, May, June, July, August, September, October, November, December", month$(), ", ")
|
||||
n = instr("JanFebMarAprMayJunJulAugSepOctNovDec", n$)
|
||||
|
||||
return month$(int(n/3) + 1)
|
||||
end sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue