Jump to content

Rolling Date


Recommended Posts

I'm not sure how to explain what I need help with, but I'll try to be as clear as possible.

Our third shift, here at work, records production on the following day.

Todays date is 04/05/05 so when they arrive tonight they will use 04/06/05.

Currently in my program they manually enter the date. I want to remove this so that the program does it for them.

I want it to roll the date thru the year and I can not figure out where to start.

It must only be applicable from 9pm to 11:59:59pm.

It needs to know if it is the last month of the year, so that it can enter the next year.

If its the last day of the month, so that the month can roll to the next along with the day.

Func Rolling_Date()
   $Month1 = @MON
   $Year = @YEAR
   $Days_In_Month = _DateDaysInMonth($Month1,$Year) 
   If @MDAY = $Days_In_Month Then 
      $Month = _DateNextMonthNum($Month1)

This is all I have. I'm having a problem thinking about how to do this. Any thoughts would be wonderful.

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
Link to comment
Share on other sites

what version?

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

This "could" be useful for you too:

#include <Date.au3>

Global $M, $D, $Y
$sJulDate = _DateToDayValue (@YEAR, @MON, @MDAY)
_DayValueToDate($sJulDate+1,$Y,$M,$D)
MsgBox(0,"",$M & "/" & $D & "/" & $Y)
Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
Link to comment
Share on other sites

  • Developers

or:

#include <date.au3>
$ScheduleDate = _NowCalcDate()
If @HOUR > 21 then $ScheduleDate = _DateAdd("d",1,_NowCalcDate())

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

Dumb question: Is it possible to install two different versions of autoit on the same PC, if so how? Both of the other two options have user defined functions not available in my version (autoit-v3.0.103.exe). If not or I would perfer the functions from date.au3 so that I can see how they work if possible.

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
Link to comment
Share on other sites

Here ya go... :) _Now(Returns the current Date and Time in PC's format.) or _NowCalc(Returns the current Date and Time in format YYYY/MM/DD HH:MM:SS for use in date calculations) would probably work too.....

Edited by quaizywabbit
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

we rely strongly (used about every 3min per 48 hour period) on the the program, and I'm not sure how much I would need to change for it to work again, if it were to crash.

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
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
 Share

  • Recently Browsing   0 members

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