Doxie Posted July 21, 2004 Share Posted July 21, 2004 Hi, its me again I'm making a inventory program, and everything is working just fine. Now i have just added the GUI "Date", so i can add when we purshased a device. But next to the date, i would like to have a countdown from 3 years, so we can see quickly how long the user will keep their device. I got one interface were i can edit, the inventory, and one view interface. When i'm using the edit, i get a GUI "Date" after each device. Now i wanna see a # of days left on the view. This is from my .ini file: Date=den 31 juli 2004 Is there anyway i can get a number count from that day 3 years forward? And then countdown it for eachday? Were ever i lay my script is my home... Link to comment Share on other sites More sharing options...
Davman Posted July 21, 2004 Share Posted July 21, 2004 hmm... well... 3 years from 31st july 2004 is, 31st july 2007. subtract one date from the other and you'll have the amount of days. Sitting comfortably behind the code. Link to comment Share on other sites More sharing options...
Doxie Posted July 21, 2004 Author Share Posted July 21, 2004 I wish it was that easy Since i'm using Jan, Feb etc... It can´t be calculated that easy, i first need to change to make a code for how many days its in Jan, Feb Well and alot of other code, this is to complicated I drop this question... Were ever i lay my script is my home... Link to comment Share on other sites More sharing options...
Davman Posted July 21, 2004 Share Posted July 21, 2004 mm, dont forget leap years Sitting comfortably behind the code. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 21, 2004 Developers Share Posted July 21, 2004 I have developed a bunch of date functions back in february to be included in the standard UDF library that is being compiled ... I believe they are still supposed to be published soon together with the new AutoIt3 release.Here is a preview/beta version of these date functions in a file called http://www.autoitscript.com/fileman/users/jdeb/test/datenew.au3.It includes a _DateDiff function which does what you need:#include <datenew.au3> msgbox(0,'test',_datediff('d',"2004/12/31", "2005/01/01"))Let me know when you find bugs or issues with it.this is the list of extra function on top of the current DATE.AU3:; _DateAdd, _DateDiff, _DateToDayValue, _DayValueToDate; _FormatDateTime, _DayOfWeek, _DateIsValid; _SplitDateTime, _Now(), _NowTime(), _NowDate(),_DaysInMonth(); _DaysOfWeek(), Nowcalc(), _JulianDayNo(), _JulianToDate($iJDay) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now