Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

The counter starts with Days. How can I display Weeks, Months and Years?

0
Posted

The counter starts with Days. How can I display Weeks, Months and Years?

0

A- As long as the desired units are constant multiples of ‘Seconds’, the code running the counter can work in a straight-forward manner. To that end, it takes a simple modification to the program to display the number of ‘Weeks’. There just hasn’t been enough demand to display the number of weeks, thus it isn’t included in the counter. Things get relatively complicated for displaying ‘Months’. Months contain varying number of days. Some are 30 days, others are 31. February is even worse, containing 28 days with an additional day every 4 years (leap years). It’s not impossible to calculate it, but it is involved and it’s departure from a simple calculation, putting stress on the computer resources. Displaying the number of ‘Years’ would be less onerous, but there are still leap years to contend with. In contrast, a century is always a constant 36,525 days, but I doubt anyone would want to display that in a counter. To make matters even more complicated, there are a variety of month and

0

A- As long as the desired units are constant multiples of ‘Seconds’, the code running the counter can work in a straight-forward manner. To that end, it takes a simple modification to the program to display the number of ‘Weeks’. There just hasn’t been enough demand to display the number of weeks, thus it isn’t included in the counter.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.