Hello p5js community!
This is my first code, sorry for that.
the result should be YRS: Y Day: DDD hh: mm: ss
such as https://climateclock.world
I wrote this code but the days calculation doesn’t work. can you help me ?
</>
var years = year();
var days = day();
var hours = hour();
var minutes = minute();
var seconds = second();
if(seconds != prevSec) {
prevSec = seconds;
years = nf (2027 - years, 1,0);
days = nf (days, 3,0);
hours = nf(24 - hours, 2, 0);
minutes = nf(60 - minutes, 2, 0);
seconds = nf(60 - seconds, 2, 0);
Text(years + "-" + days + "-"+ hours + ":" + minutes + ":" + seconds);
}
</>