DigDeep Posted August 28, 2018 Posted August 28, 2018 Hi, I am converting -NowDate() format from 'M/DD/YYYY' to 'MM/DD/YYYY' and it looks weird that out of 10 machines 2 machines give the below error. Is there any other way I can try this out to get the date format in MM/DD/YYYY? Local $Today = _NowDate() ; Get Today's Date Local $Date = StringSplit($Today, "/") Local $GetAppDate = StringRight($Today, 2) < StringLeft(@YEAR, 2) ? StringFormat("%02d/%02d/%d", $Date[1], $Date[2], $Date[3]) : StringFormat("%02d/%02d/%d", $Date[1], $Date[2], $Date[3]) ; Convert _NowDate() M/DD/YYYY to MM/DD/YYYY Error: Array variable has incorrect number of subscripts or subscript dimension range
FrancescoDiMuro Posted August 28, 2018 Posted August 28, 2018 @DigDeep On those two machines, put an _ArrayDisplay(), which displays the $Date array. That error means that $Date has less values than you are "requesting". Do that try, and let us know Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
jchd Posted August 28, 2018 Posted August 28, 2018 Maybe the failing machines use another locale, hence some separator but not a slash. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
caramen Posted August 28, 2018 Posted August 28, 2018 Guessing about check the local time settings. When you got 4 results in one variable. If you're trying to access to a non existing result in that variable you gonna have this error. You can use UBound to count the number of result in a variable. My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
xcaliber13 Posted August 29, 2018 Posted August 29, 2018 I use this to format dates Local $hDate = StringFormat("%02u/%02u/", @MON, @MDAY) & StringRight(@Year, 4) ; Format = MM/DD/YYYY This will get you current date in the format you are looking for.
rudi Posted August 30, 2018 Posted August 30, 2018 Hi, @Melba23 has a UDF that might help you (just noticed it in some of Melba's postings, never tried it) Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
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