Jump to content

Recommended Posts

Posted

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!

Posted

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

Change 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

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
×
×
  • Create New...