Question...

Tuesday, February 15, 2005 by r0u2n | Discussion: DesktopX

I am looking for a simple either object or widget. I would like something that i could use to keep track of how many days have gone by in a given period of time. Such as if I were to reset it today, tomorrow it would read one day, and then the next day 2 days, ect. But i do need to be able to reset it. Does anybody know of one that is out there, or how to create one like that?
Leszek Karcz
Reply #1 Friday, February 18, 2005 10:43 PM
I dont now if there are such obiects/widgets, I saw some that were counting backwards. But you can make one for your own, its very simple, first you must store somewhere the date from when you want to count the days for example in .txt file or windows registry. Then simply create object with timer so it will refresh every minute, hour, etc. or eny time you want. and to display number of days just import the starting date from where you stored it and use this:

number_of_days = DATE-(CDATE(date_when_started))

the date must be in format YYYY-MM-DD
so if today is 19.02.2005 and I would have started hmm. lets say 20.01.2005 it would look like this:

date_when_started = "2005-01-20"
number_of_days = DATE-(CDATE(date_when_started))

the number_of_days would be 30

function DATE returns the current date and function CDATE() converts a string to date type, you must use this when you save the starting date as a string.

I hope I made it clear
if you want some help with storing/importing date just say.
Good luck with makeing this obiect

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01