weekday of last day of a month
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi!
How do I find the weekday of the last day of any month in any year?
Thanks!
0 commentaires
Réponse acceptée
Dyuman Joshi
le 17 Juil 2023
Modifié(e) : Dyuman Joshi
le 17 Juil 2023
%Current Month
y = 2023;
m = 7;
%Get the date of the last day of the month
day = eomday(y,m)
%Get the weekday of the last day of the month
[DayNumber,DayName] = weekday(datetime(y,m,day))
Edit - In case you want the long name of the day, simply use -
[DayNumber,DayName] = weekday(datetime(y,m,day), 'long')
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!