Recent Changes - Search:

Oktatás

* Programozás 2
  + feladatsor
  + C feladatsor
  + Python feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

* Adator. prog.
  + feladatsor
  + quick link

Teaching

* Prog. for Data Sci. (TODO)

teaching assets


Félévek

* 2025/26/1
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* Scala


[ edit | logout ]
[ sandbox | passwd ]

date and time

See also std.datetime.date.

(1) simple examples
import std.stdio;
import std.datetime;

bool isLeapYear(const int year) pure {
    return yearIsLeapYear(year);
}

void main()
{
    auto today = Date(2025, 8, 19); // Aug 19, 2025
    auto xmas = Date(2025, 12, 24); // Dec 24, 2025

    assert(today < xmas); // true

    writeln(today); // "2025-Aug-19"

    today += dur!"days"(1); // add 1 day

    writeln(today); // "2025-Aug-20"
    writeln(today.dayOfWeek()); // wed
    assert(today.dayOfWeek() == DayOfWeek.wed); // true

    writeln(isLeapYear(2020)); // true
}

Notes:

  • Easy to create a date object from a date.
  • Dates are comparable with <, , etc.
  • When you print a date, it uses a format that is completely clear to understand.
  • Easy to increment/decrement a date.
  • Easy to figure out the day of a date (Monday, Tuesday, etc.).
Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2025 August 19, 17:01