Sign in to follow this  
Followers 0
jamesnewbie

Help with date formats

5 posts in this topic

I've spent ages trying to figure out who to add 7 days to the current date and put it into DDMMYY format.

I can do both indivdually MsgBox ( 0, "DDMMYY", @MDAY & @MON & StringRight (@Year, 2 ) ) and $sNewDate = _DateAdd( 'd',5, _NowCalcDate()) but can't do both.

Any help would be appreciate - oh I also need to SEND it so please advise how I send the variable once it's calculated and formatted.

Send("090708")

Thanks

Share this post


Link to post
Share on other sites



Something like this:

#include<date.au3>
$sNewDate = _DateAdd('d', 5, _NowCalcDate())
$aNewDate = StringSplit($sNewDate,"/")
$Date = $aNewDate[3] & $aNewDate[2] & $aNewDate[1]

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

#include <Date.au3>
$sNewDate = _DateAdd( 'd',7, _NowCalcDate())
;Convert YYYY/MM/DD to DDMMYYYY
$new = StringRegExpReplace($sNewDate, "\A(\d{4})/(\d{2})/(\d{2})","$3$2$1")
MsgBox(0,"",$new)oÝ÷ Ù«­¢+Ø¥¹±Õ±ÐíѹÔÌÐì(ÀÌØíÍ9ÝÑô}Ñ ÌäíÌäì°Ü°}9½Ý
±Ñ ¤¤(í
½¹ÙÉÐeeed½54½Ñ¼55ed(ÀÌØí¹ÜôMÑÉ¥¹IáÁIÁ± ÀÌØíÍ9ÝÑ°ÅÕ½ÐìÀäÈí¸¸ ÀäÈíìÉô¤¼ ÀäÈíìÉô¤¼ ÀäÈíìÉô¤ÅÕ½Ðì°ÅÕ½ÐìÀÌØìÌÀÌØìÈÀÌØìÄÅÕ½Ðì¤)5Í   ½à À°ÅÕ½ÐìÅÕ½Ðì°ÀÌØí¹Ü¤

Edited by weaponx

Share this post


Link to post
Share on other sites

Excellent - thank you very much for your help - really appreciate it muttley

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