13,767,051 members
See more:
Hello
i am a beginner with programming and I am learning F#, and I want to write code for weekdays so I want to type the date and the program should give me the day, can anyone help me with that?

What I have tried:

Posted 8-Nov-18 14:28pm
Updated 8-Nov-18 15:06pm
v2

## Solution 2

Quote:

Never thought about checking the documentation ?

I let you do the search as an exercise.

module Wochentag
open Mini

let wochentag(tag: Nat, monat: Nat, jahr: Nat): string =
let q:Nat = tag
let m:Nat = monat
if m<3N then m+12N else m
if m<3N then jahr+1N else jahr
let K:Nat = jahr % 100N
let J:Nat = jahr/100N
let h:Nat = (q+((13N*(m+1N))/5N)+K+(K/4N)+(J/4N)-2N*J) % 7N
if h=0N then "Samstag"
else if h=1N then "Sonntag"
else if h=2N then "Montag"
else if h=3N then "Dienstag"
else if h=4N then "Mittwoch"
else if h=5N then "Donnerstag"
else if h=6N then "Freitag"
else "falsch gemacht"

Top Experts
Last 24hrsThis month
 OriginalGriff 431 CPallini 305 CHill60 185 Aydin Homay 139 Richard MacCutchan 125
 OriginalGriff 2,762 Richard MacCutchan 1,715 CPallini 884 MadMyche 785 CHill60 485