Jump to content

get all dates of days this week


Recommended Posts

Hi,

try this:

#include <Date.au3>
#include <Array.au3>

Global $this_week[7]

For $i = 0 To 6
    $this_week[$i] = _DateAdd("D", $i + 1 - @WDAY, _NowCalcDate())
Next
; option: add " <--" to indicate today
$this_week[@WDAY-1] &= " <--"
_ArrayDisplay($this_week)

edit: or this, if you want the weekdays shown as well

#include <Date.au3>
#include <Array.au3>

Global $this_week[7][2] = [ ["", "Sun"], ["", "Mon"], ["", "Tue"], ["", "Wed"], ["", "Thu"], ["", "Fri"], ["", "Sat"] ]

For $i = 0 To 6
    $this_week[$i][0] = _DateAdd("D", $i + 1 - @WDAY, _NowCalcDate())
Next
$this_week[@WDAY-1][1] &= " <--"    ; optionally add " <--" to indicate today
_ArrayDisplay($this_week)

(tested on 3.3.6.1 / Win 7)

Edited by whim
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...