Create calendars

How can I encode a calendar? I mean, how can I determine the days of the month, is it the 1st Monday, Tuesday or something else. how many days in a particular month, etc.

I mainly use PHP and C #. But I'm mostly looking for logic

+3
source share
3 answers

Take a look at the type DateTimein MSDN for C #.

You can define the weekday of a given day as follows:

var date = DateTime.Parse("16.10.2010");

Console.WriteLine(date.DayOfWeek);

If you are looking for the number of days per month, try the following:

Console.WriteLine(DateTime.DaysInMonth(date.Year, date.Month));
+1
source

( PHP #) , , .

PHP date() getdate() , , , timestamp.

, PHP mktime(), , getdate(), .

, , (, Jan = 31, ..), , 1- , 24 , .

PHP (, 5.3), , . ( PHP 5.2, , 5.3).

+1

GregorianCalendar #. , "" .

, , DateTime .

+1

Source: https://habr.com/ru/post/1769870/


All Articles