skyhawk Posted August 24, 2010 Share Posted August 24, 2010 (edited) Hi Everyone! I need some help formating the returned value of _NowCalcDate. I need the result to be in the following format of MMDDYY instead of MM/DD/YYYY which it currently is returned as. #include <Date.au3> ; Add 5 days to today $sNewDate = _DateAdd( 'd',5, _NowCalcDate()) MsgBox( 4096, "", "Today + 5 days: " & $sNewDate ) How would I go about doing that? Thanks everyone for your help Edited August 24, 2010 by skyhawk Link to comment Share on other sites More sharing options...
bogQ Posted August 24, 2010 Share Posted August 24, 2010 (edited) MsgBox( 4096, "", "Today + 5 days: " & StringReplace($sNewDate,"/","") ) and use StringLeft to get the rest Edited August 24, 2010 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted August 24, 2010 Share Posted August 24, 2010 This'll do it.. StringTrimLeft(StringReplace($sNewDate,"/",""), 2) - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Spiff59 Posted August 25, 2010 Share Posted August 25, 2010 (edited) You probably ought to just do it the old-fashioned way: $sNewDate = StringLeft($sNewDate, 2) & StringMid($sNewDate, 4, 2) & StringRight($sNewDate, 2) Edit: Realize though, you are risking the wrath of the Y2K gods. Edited August 25, 2010 by Spiff59 Link to comment Share on other sites More sharing options...
skyhawk Posted August 25, 2010 Author Share Posted August 25, 2010 Ah very cool. Thanks everyone for all the great ideas. I'll give them a go tomorrow 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