Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1146

Help: Rainmeter Skins • Re: day count on rainmeter

$
0
0
on rainmter, I wonder if it is possible to have a countdown in day, month, year, from a date (example September 20, 2004 to the current day),
Yep, definitely possible and it's not even hard to achieve. But this might look like a not-alowed skin / code request. However I post a short solution, to let you realize how can this be done.
You need two Time measures, one returning the current date and another returning the start date. Let's name them [MeasureNow] and [MeasureStart]. Add them to your code:

Code:

[MeasureNow]Measure=Time[MeasureStart]Measure=TimeTimeStamp=#Year#.#Month#.#Day#TimeStampFormat=%Y.%m.%d
In the [MeasureStart] measure I used the #Year#, #Month# and #Day# variables, which are storing the start date. Add them to the [Variables] section:

Code:

[Variables]Year=2004Month=09Day=20
Finally you need a Calc measure, which calculates in seconds the difference between the two dates: the current and the start one. Add it this measure as well:

Code:

[MeasureDiff]Measure=CalcFormula=( [MeasureNow:TimeStamp] - [MeasureStart:TimeStamp] )DynamicVariables=1
As said, this measure returns the difference in seconds (extremely important to be kept in mind!).
Now you have to calculate the number of years, months and days, from the number of seconds. I don't post now a solution for this, hope you'll be able to manage it. Check please the above solution and let me / us know if you can't deal with it.

Statistics: Posted by balala — Today, 7:09 pm



Viewing all articles
Browse latest Browse all 1146

Trending Articles