kawliga751 Posted June 12, 2017 Posted June 12, 2017 I have established how to get tomorrows date however I can't seem to figure out how to format the date into my required format of MM/DD/YYYY. I have this: $today=_DateToDayValue(@YEAR,@MON,@MDAY) Dim $Y, $M, $D $tomorrow=_DayValueToDate($today+1, $Y, $M, $D) The _DateToDayValue seems to have a fixed format. I've also tried a : $vardate = _DateAdd( 'd',1, _NowCalcDate()) with a "StringSplit" and/or StringFormat but the _NowCalcDate seems to also be fixed to a YYYY/MM/DD format. I'm sure I'm missing something simple but am at a loss. Any help would be MUCH appreciated
anthonyjr2 Posted June 12, 2017 Posted June 12, 2017 Have you tried _NowDate? UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=
Danyfirex Posted June 12, 2017 Posted June 12, 2017 Hello. Try this. #include <Date.au3> Local $today=_DateToDayValue(@YEAR,@MON,@MDAY),$Y, $M, $D Local $tomorrow=_DayValueToDate($today+1, $Y, $M, $D) $tomorrow= StringFormat("%02i/%02i/%04i", $M, $D, $Y) ConsoleWrite($tomorrow & @CRLF) Saludos JDGamboaG and kawliga751 2 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
kawliga751 Posted June 12, 2017 Author Posted June 12, 2017 Danyfirex: This worked PERFECTLY!. I have never seen s StrngFormat like this and, I would've probably NEVER found it on my own. MANY Thanks
Danyfirex Posted June 12, 2017 Posted June 12, 2017 You're welcome mate. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
JDGamboaG Posted May 28, 2018 Posted May 28, 2018 I had a similar predicament and it has been solved as well. Thank you. But: why does it work??! You're putting arguments outside of the function call! to say the least.
Bilgus Posted May 29, 2018 Posted May 29, 2018 @JDGamboaG I see why you are confused but look at it like this #include <Date.au3> Local $today Local $Y Local $M Local $D $today = _DateToDayValue(@YEAR,@MON,@MDAY) Local $tomorrow $tomorrow = _DayValueToDate($today+1, $Y, $M, $D) ;< [Y, M, D] those are by reference $tomorrow = StringFormat("%02i/%02i/%04i", $M, $D, $Y) ConsoleWrite($tomorrow & @CRLF) this is exactly the same thing posted by Danyfirex just spread out
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