gcue Posted August 6, 2009 Posted August 6, 2009 hello. i am trying to get yesterdays date with this: MsgBox(0,"",_DateTimeFormat(_DateAdd("D",-1,_NowCalcDate()),0)) but i am trying to preserve the zeros when either the month or day are single digit... ie: 01/04/2009 instead of 1/4/2009 any ideas? thanks!
somdcomputerguy Posted August 6, 2009 Posted August 6, 2009 Maybe replace _NowCalcDate with @YEAR & "/" & @MON & "/" & @MDAYSee Macros - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
somdcomputerguy Posted August 6, 2009 Posted August 6, 2009 Notice that most return values are two-digits long.From the 'Time and Date Macros' section of the AutoIt help file - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
picaxe Posted August 6, 2009 Posted August 6, 2009 but i am trying to preserve the zeros when either the month or day are single digit... ie: 01/04/2009 instead of 1/4/2009Change your pc's regional short date to "dd/MM/yyyy" or use ConsoleWrite(StringRegExpReplace(_DateAdd("D",-1,_NowCalcDate()), '(\d+)/(\d+)/(\d+)', '$3/$2/$1') & @LF)instead of _DateTimeFormat
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