31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

string D.get month name( ) returns the name of the month of D in the current<br />

language.<br />

int D.get year( ) returns the year part of D.<br />

bool D.set day(int d) sets the day part of D to d, i.e. if D is d’.m.y then D<br />

is set to d.m.y.<br />

bool D.add to day(int d) adds d days to D (cf. arithmetic operations).<br />

bool D.set month(month m)<br />

bool D.add to month(int m)<br />

sets the month part of D to m.<br />

adds m months to the month part of D.<br />

Let D be d.m’.y, then it is set to d.(m’ + m).y. If<br />

this produces an overflow (i.e. m ′ + m > 12) then the<br />

month part is repeatedly decremented by 12 and the<br />

year part is simultaneously incremented by 1, until the<br />

month part is valid. (An underflow (i.e. m ′ + m < 1)<br />

is treated analogously.) <strong>The</strong> day part of the result is<br />

set to the minimum of d and the number of days in<br />

the resulting month.<br />

bool D.set year(int y) sets the year part of D to y.<br />

bool D.add to year(int y) adds y years to the year part of D.<br />

(If D has the form 29.2.y’ and y’ + y is no leap year,<br />

then D is set to 28.2.(y’ + y).)<br />

int D.get day of week( ) returns the day of the week of D.<br />

(1=Monday, 2=Tuesday, . . . , 7=Sunday)<br />

string D.get dow name( ) returns the name of the weekday of D in the current<br />

language.<br />

int D.get week( ) returns the number of the calendar week of D (range<br />

[1,53]).<br />

A week always ends with a Sunday. Every week belongs<br />

to the year which covers most of its days. (If the<br />

first Sunday of a year occurs before the fourth day of<br />

the year, then all days up to this Sunday belong to<br />

the last week of the preceding year. Similarly, if there<br />

are less than 4 days left after the last Sunday of a<br />

year, then these days belong to the first week of the<br />

succeding year.)<br />

int D.get day in year( ) returns the number of the day in the year of D (range<br />

[1;366]).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!