C# da Data time vaqtlar:
C# da sana va vaqtlar bilan ishlashda Data time strukturasi qo'llanadi.
Bu yerda new kalit so'zidan foydalaniladi.
DateTime.Now -> bu hozirgi tizim vaqtini ko'rsatadi.
Belgilangan sanani olish bor bunda new DateTime(year, month, day)
yoki new DateTime(hour, minut, secund). bo'lgan holda uchraydi.
DateTime vaqtlar ustida amallar bajarish mumkin(qo'shish va ayirish)
1.Qo'shish -> today.AddDays(1) dan foydalaniladi.
Qavs ichidagi kunni kunga qo'shadi.
- Ayirish -> ikki kunni o'zgaruvchi tarzda berib ikkitasini ayirib qo'ysa bas. ShortDateString va LongDateString nima? ShortDateString bu vaqt va kunni qisqa ko'rinishidagi shakli. LongDateString bu vaqt va kunni uzun ko'rinishidagi shakli. Masalan(shortga: 7/31/2024) Masalan(longga: Thursday, 7th of July, 2024)
//English version
Data time in C# is:
C# uses the Data time structure when dealing with dates and times.
The keyword new is used here.
DateTime.Now -> this shows the current system time.
Get the specified date with new DateTime(year, month, day)
or new DateTime(hour, minute, second). occurs as
DateTime operations can be performed on times (adding and subtracting)
1.Add -> today.AddDays(1) is used.
Adds the day in parentheses to the day.
- Subtraction -> give two days in a variable way and subtract two. What is ShortDateString and LongDateString? ShortDateString is a short form of time and date. LongDateString is the long form of the date and time. For example (to short: 7/31/2024) For example(longga: Thursday, 7th of July, 2024)
Top comments (1)
like