View Single Post
 
Old 09-02-2020, 09:18 AM
eduzs eduzs is offline Windows 10 Office 2019
Expert
 
Join Date: May 2017
Posts: 266
eduzs is on a distinguished road
Default

For the 1st question, this seems to work (need to do more tests):

{QUOTE {SET Delay 0}{SET a{=INT((14-{DATE \@ M})/12)}}{SET b{={DATE \@ yyyy}+4800-a}}{SET c{={DATE \@ M}+12*a-3}}{SET d = 1 }{SET jd{=d+INT((153*c+2)/5)+365*b+INT(b/4)-INT(b/100)+INT(b/400)-32045+Delay}}{SET e{=INT((4*(jd+32044)+3)/146097)}}{SET f{=jd+32044-INT(146097*e/4)}}{SET g{=INT((4*f+3)/1461)}}{SET h{=f-INT(1461*g/4)}}{SET i{=INT((5*h+2)/153)}}{SET dd{=h-INT((153*i+2)/5)+1}}{SET mm{=i+3-12*INT(i/10)}}{SET yy{=100*e+g-4800+INT(i/10)}}"{dd}-{mm}-{yy}" \@ "d/M/yyyy"}

For the 2nd question, if I change "DATE" to "DOCVARIABLE mydate" it not work, cause in this situation the delay should be count from the 1st day of the next month before mydate, and not the 1st day of the current month.
__________________
Backup your original file before doing any modification.
Reply With Quote