Sign in to follow this  
Followers 0
skyhawk

Format _NowCalcDate

5 posts in this topic

#1 ·  Posted (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 by skyhawk

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

MsgBox( 4096, "", "Today + 5 days: " & StringReplace($sNewDate,"/","") )

and use StringLeft to get the rest

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by Spiff59

Share this post


Link to post
Share on other sites

Ah very cool. Thanks everyone for all the great ideas. I'll give them a go tomorrow ;)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0