만기일이 20250911이라면
만기까지 남은 일수를 정수로 표시하고 싶습니다
답변 1
예스스탁
예스스탁 답변
2025-09-10 09:50:23.0
안녕하세요
예스스탁입니다.
Var : Year(0),Month(0),ndate1(0),ndate2(0);
var : cnt(0),count1(0),count2(0);
var : XD1(0),XD2(0),Xdate(0),remain(0);
Year = Floor(sDate / 10000)*10000;
month = Floor(FracPortion(sdate/10000)*100)*100;
ndate1 = year+month+1;
if Month+100 <= 1200 Then
ndate2 = year+(month+100)+1;
Else
ndate2 = (year+10000)+100+1;
count1 = 0;
count2 = 0;
for cnt = 0 to 15
{
if dayofweek(ndate1+cnt) == 4 Then
{
count1 = count1+1;
if count1 == 2 Then
{
XD1 = ndate1+cnt;
}
}
if dayofweek(ndate2+cnt) == 4 Then
{
count2 = count2+1;
if count2 == 2 Then
{
XD2 = nDate2+cnt;
}
}
}
if sDate <= XD1 Then
{
Xdate = XD1;
}
Else
{
Xdate = XD2;
}
if Xdate > 0 Then
{
remain = DateToJulian(Xdate)-DateToJulian(sDate);
Plot1(remain);
}
즐거운 하루되세요
> 아슬란 님이 쓴 글입니다.
> 제목 : 만기일까지 잔존일수 지표
> 만기일이 20250911이라면
만기까지 남은 일수를 정수로 표시하고 싶습니다