Jump to content

Countdown from specific date?

Recommended Posts

Hi, its me again :ph34r:

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

I wish it was that easy :ph34r:

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

  • Developers

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...