Вверх ↑
Ответов: 9906
Рейтинг: 351
#1: 2016-05-02 16:27:36 ЛС | профиль | цитата
kaban4ik писал(а):
Посмотрел, аналога в KOL вроде не нашел

А это (из Kol.pas) разве не оно
#pas
procedure IncMonths( var SystemTime : TSystemTime; MonthsNum : Integer );
{* Increases/decreases month number in TSystemTime record onto given
months count (can be negative). Correct result is not garantee if
day number is incorrect for newly obtained month. }
.............
//[procedure IncMonths]
procedure IncMonths( var SystemTime : TSystemTime; MonthsNum : Integer );
var M : Integer;
DateTime : TDateTime;
begin
M := SystemTime.wMonth + MonthsNum - 1;
Inc( SystemTime.wYear, M div 12 );
SystemTime.wMonth := M mod 12 + 1;

// Normalize wDayOfWeek field:
SystemTime2DateTime( SystemTime, DateTime );
DateTime2SystemTime( DateTime, SystemTime );
end;
карма: 9

0