Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9310199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:03:18+00:00 2026-06-19T01:03:18+00:00

I have a powershell GUI calendar in which you can select a range of

  • 0

I have a powershell GUI calendar in which you can select a range of dates. I need to be able to covert that info into an array of dates formatted YYYYMMDD.

I know $Date = “{0:yyyyMMdd}” -f (Get-Date) will work but I can’t seem to get the items into the array.

I need an array like this:

20130211
20130212
20130213

Here’s the code so far. Thanks for your help!

$Calendar = New-Object System.Windows.Forms.MonthCalendar 
$Calendar.Location = New-Object System.Drawing.Size(10,80)
$Calendar.ShowTodayCircle = $False
$Calendar.MaxDate = (Get-Date).AddDays(1)
$Calendar.MaxSelectionCount = $CalendarSelect
$MenuBox.Controls.Add($Calendar) 
$Dates = $Calendar.SelectionRange

So $Dates will need to be converted into the array. Thanks again!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T01:03:20+00:00Added an answer on June 19, 2026 at 1:03 am

    The SelectionRange property of MonthCalendar returns a SelectionRange object with a Start and End property indicating the start and end of the range. You will need to just loop through the range to get the output you want:

    for($d = $dates.Start; $d -le $dates.End; $d = $d.AddDays(1)){get-date $d -Format "yyyyMMdd"}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a gui with powershell that allows me to copy files from
I have PowerShell v2.0 installed and on top of that, PSCX is installed. PSCX
I have a powershell script that will generate an email for users whose password
Currently I have a powershell proccess that is scanning a SQL Server Table and
I have PowerShell 3 installed, and I need to run PowerShell 2 from Cygwin
I have a powershell script I uses for daily releases which works fine. However,
I have a powershell script that runs a console .exe application. The console application
Background: Suppose I have a powershell function that understands and interprets small_commands such as:
I have the below code that does various things and checks hotfix info. I
I have a PowerShell script for which I would like to redirect the output

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.