Khautekier Posted December 5, 2006 Posted December 5, 2006 Hi all,i wrote some code to start an application every nn minutes.if the initial time is set to 01 minute. the code works fine and change from 2006/12/05 23:00:01 to 2006/12/06 00:00:01if the initial time is set to 00 minute. the DateAdd function Starts incrementing the days instead of the hours -from 2006/12/05 22:00:00 to 2006/12/05 23:00:00 ( )-from 2006/12/05 23:00:00 to 2006/12/06 23:00:00 ( )-from 2006/12/06 23:00:00 to 2006/12/07 23:00:00 Is this a bug with _dateAdd of could anybody tell me what i am doing wrong?#include <Constants.au3> #include <GUIConstants.au3> #include <Date.au3> $Sample_Interval = 60 $Next_sample_time = "2006/12/05 19:00:01" while 1 $Next_sample_time = _DateAdd( 'n',$Sample_Interval, $Next_sample_time) $Answer = MsgBox(1,"Correct DateAdd",$Next_sample_time) if $Answer = 2 then ExitLoop WEnd $Sample_Interval = 60 $Next_sample_time = "2006/12/05 19:00:00" while 1 $Next_sample_time = _DateAdd( 'n',$Sample_Interval, $Next_sample_time) $Answer = MsgBox(1,"Wrong DateAdd",$Next_sample_time) if $Answer = 2 then ExitLoop WEnd
/dev/null Posted December 5, 2006 Posted December 5, 2006 Is this a bug with _dateAdd of could anybody tell me what i am doing wrong?as far as I can see there are bugs in _DateAdd and _TicksToTime (in Date.au3).CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
Developers Jos Posted December 5, 2006 Developers Posted December 5, 2006 (edited) as far as I can see there are bugs in _DateAdd and _TicksToTime (in Date.au3).CheersKurt_TicksToTime() didn't handle Ticks=0 properly .Changed it in attached version of Date.au3.See if that fixes you issues and let me know...I will commit this change for the next version. Edited December 5, 2006 by JdeB 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.
/dev/null Posted December 5, 2006 Posted December 5, 2006 (edited) _TicksToTime() didn't handle Ticks=0 properly .Changed it in attached version of Date.au3.See if that fixes you issues and let me know...I will commit this change for the next version. See my post: http://www.autoitscript.com/forum/index.php?showtopic=37371I have a different fix, but both of them do work! Yours is more generic.CheersKurt Edited December 5, 2006 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
Developers Jos Posted December 5, 2006 Developers Posted December 5, 2006 See my post: http://www.autoitscript.com/forum/index.php?showtopic=37371I have a different fix, but both of them do work! Yours is more generic.CheersKurtI think the _TicksToTime() mneeds the fix not _DateAdd() whicg depents on _TicksToTime .I will Update the Bug thread .... Thanks 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.
/dev/null Posted December 5, 2006 Posted December 5, 2006 I think the _TicksToTime() mneeds the fix not _DateAdd() whicg depents on _TicksToTime .I will Update the Bug thread .... Thankswell, actually it does not matter what you fix, because _TicksToTime is only used by _DateAdd(). However I agree with your fix. It's the better place to fix this problem.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
Developers Jos Posted December 5, 2006 Developers Posted December 5, 2006 well, actually it does not matter what you fix, because _TicksToTime is only used by _DateAdd(). However I agree with your fix. It's the better place to fix this problem.CheersKurtPartially true... _TicksToTime () is a published UDF and should return a correct value in case the Ticks is 0, thats why I fixed it in the _TicksToTime function ...Thanks for your help on this one . 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.
Khautekier Posted December 5, 2006 Author Posted December 5, 2006 Hi Guys, It fixed my problem. thanks. now it is working fine. Thanks.
/dev/null Posted December 5, 2006 Posted December 5, 2006 Partially true... _TicksToTime () is a published UDF and should return a correct value in case the Ticks is 0, thats why I fixed it in the _TicksToTime function ...Thanks for your help on this one .yep, you're right. Did'nt know that _TickToTime() is a published UDF.....CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
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