Skip links

Yılın Başlangıç Tarihi ve Ayları Bir Bir Arttırmak


Notice: Trying to access array offset on value of type bool in /var/www/vhosts/dmrbt.com/httpdocs/wp-content/themes/boo/rella/extensions/aq_resizer/aq_resizer.php on line 117

Notice: Trying to access array offset on value of type bool in /var/www/vhosts/dmrbt.com/httpdocs/wp-content/themes/boo/rella/extensions/aq_resizer/aq_resizer.php on line 118

Notice: Trying to access array offset on value of type bool in /var/www/vhosts/dmrbt.com/httpdocs/wp-content/themes/boo/rella/extensions/aq_resizer/aq_resizer.php on line 117

Notice: Trying to access array offset on value of type bool in /var/www/vhosts/dmrbt.com/httpdocs/wp-content/themes/boo/rella/extensions/aq_resizer/aq_resizer.php on line 118
Yılın Başlangıç Tarihi ve Ayları Bir Bir Arttırmak

Aylık rapoları yaparken sık sık karşılaştığımız bir problem var; Yılın başlangıç tarihini bulup sonra ay ay bu tarihi arttırmak
Yılın başlangıç tarihini bulmak için  datestartyr(offsetDate); fonksiyonu kullanılabilir.
ayları bir bir arttırmak için ise  DateMthFwd(offsetDate ,1);
Aşağıdaki job örneğinde hangi başlangıç tarihi verirseniz o tarihten itibaren 12 ay boyunca ay ay tarih değiştiriyor.

Date offsetDate;
Date columDate;
int colum;
int counter;
offsetDate = datestartyr(today());
columDate = offsetDate;
while (count<=11)
{
count++;
if(columDate < dateEndYr(offsetDate))
{
colum = mthOfYr(columDate) – mthOfYr(offsetDate)+1;
}
else
{
colum = 12 – mthOfYr(offsetDate) + mthOfYr(columDate) +1;
}
print strFmt(‘Date : %1 Month: %2’ , columDate, colum);
columDate =dateMthFwd(columDate,1);
}
pause;

Join the Discussion