13lack13lade Posted March 2, 2014 Share Posted March 2, 2014 Hey guys, I have a script that currently uses nowcalcdate to give me today and yesterdays date.. in the current format e.g 020314 ddmmyy and worked fine however now it is sending 2014/03/02 Need it to be fixed to return values in ddmmyy format and im not sure whats happened for it to suddenly change how it is sent.. Func _Convert($date) Return StringRegExpReplace($date, '\d\d(\d\d)/(\d\d)/(\d\d)', '$3$2$1') EndFunc $today = _NowCalcDate() $yesterday = _DateAdd('d', -1, $today) Link to comment Share on other sites More sharing options...
JohnOne Posted March 2, 2014 Share Posted March 2, 2014 Can you post some code that can be tested. The above does not show your problem. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
13lack13lade Posted March 2, 2014 Author Share Posted March 2, 2014 That is the only code i use besides Send($yesterday) send($today) as send key strokes to get the date values entered into the system.. Link to comment Share on other sites More sharing options...
JohnOne Posted March 2, 2014 Share Posted March 2, 2014 You probably need to include the appropriate header then to start. Also, what is the function you posted for? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
13lack13lade Posted March 2, 2014 Author Share Posted March 2, 2014 (edited) expandcollapse popup#include <date.au3> #Include<file.au3> #include<ie.au3> ;date function & variable Func _Convert($date) Return StringRegExpReplace($date, '\d\d(\d\d)/(\d\d)/(\d\d)', '$3$2$1') $today = _NowCalcDate() $yesterday = _DateAdd('d', -1, $today) EndFunc ;open calypso & login Run("C:\Program Files\InterSoft International, Inc\NetTerm\netterm.exe") Sleep(4000) Send("{ENTER}") Sleep(2000) Send("username") Sleep(1000) Send("{ENTER}") Sleep(1000) Send("password") Sleep(1000) Send("{ENTER}") Sleep(1000) Send("ras") Sleep(700) Send("{ENTER}") Sleep(700) Send("k_arabian") Sleep(700) Send("{ENTER}") Sleep(700) Send("*") Sleep(500) Send("{ENTER}") Sleep(500) Send("*") Sleep(500) Send("{ENTER}") Sleep(500) Send("*") Sleep(500) Send("{ENTER}") Sleep(500) Send("*") Sleep(500) Send("{ENTER}") Sleep(500) Send("H") Sleep(500) Send("{ENTER}") Sleep(500) Send("dxb") Sleep(500) Send("{ENTER}") Sleep(500) Send("ara") Sleep(500) Send("{ENTER}") Sleep(500) Send("*") Sleep(500) Send("{ENTER}") Sleep(500) Send("*") Sleep(500) Send("{ENTER}") Sleep(500) Send($yesterday) Sleep(500) Send("{ENTER}") Sleep(500) Send($today) Sleep(500) Send("{ENTER}") Sleep(500) Send($today) Sleep(500) Send("{ENTER}") Sleep(500) Send("311014") Sleep(500) Send("{ENTER}") There is some more of the script... i just need $yesterday to be yesterdays date to be sent in ddmmyy format and $today to send todays date in ddmmyy format.. it worked absolutely fine then one day just broke..so im not sure whats happened guessing the function is what is used to change from yyyymmdd to ddmmyy as someone on the forum previously helped me but i cant seem to find it. Found my previous post However that is the exact code im using and for some reason its not changing the format... Edited March 2, 2014 by 13lack13lade Link to comment Share on other sites More sharing options...
JohnOne Posted March 2, 2014 Share Posted March 2, 2014 #include <date.au3> $today = _NowCalcDate() MsgBox(0,"Today", _Convert($today)) $yesterday = _DateAdd('d', -1, $today) MsgBox(0,"Yesterday", _Convert($yesterday)) Func _Convert($date) Return StringRegExpReplace($date, '\d\d(\d\d)/(\d\d)/(\d\d)', '$3$2$1') EndFunc ;==>_Convert AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
13lack13lade Posted March 2, 2014 Author Share Posted March 2, 2014 im retarded... needed to have $nowdate= _NowCalcDate() then $today =_convert($nowdate) Thanks!!!!!! Link to comment Share on other sites More sharing options...
water Posted March 3, 2014 Share Posted March 3, 2014 To make your script more reliable I suggest to replace Send with ControlSend. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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