Sign in to follow this  
Followers 0
roman

Find out the day of month of yersterday?

6 posts in this topic

Hi

How can i find out the day of month of yersterday? @DAY-1 doesn't work because i could get a zero if today is the first of month. :D

Greetings, Roman.

Share this post


Link to post
Share on other sites



Well...

If @MDAY - 1 = 0 Then

$Mon = @MON -1

Else

$Mon = @MON

EndIf

Is that what you wanted?

Not exactly. That gives me back the last or the current month. I need a date macro like "@MYESTERDAY".

For example: Today could be the date 2006 07 01. The date macro @MDAY gives me back a "01", ok?

Now, i need something that gives me back a "30" because yesterday was the date 2006 06 30.

???

Thanks!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Get beta and look up _DateAdd

Edit:

#include <Date.au3>

$sNewDate = _DateAdd( 'D',-1, _NowCalcDate())

MsgBox( 4096, "", "Yesterday's Date: " & $sNewDate )

Exit

Edited by Manadar

Share this post


Link to post
Share on other sites

Thanks to both, i will check it! :D

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