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 8385859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:46:25+00:00 2026-06-09T17:46:25+00:00

Alright, so I have the following code to grab the last 4 characters in

  • 0

Alright, so I have the following code to grab the last 4 characters in a folder name, which will always be date, formatted as MMDD. This date will always be a Monday date as well.

Folder name example being trimmed below: C:\Temp\Textfiles\20120813

Dim MMDD_Date As String = Microsoft.VisualBasic.Right(TextBox1_Path.Text, 4)

What I’m unsure of, is how to calculate the remaining days for that week, ending on a Friday. Obvioulsy you cant convert the string to an int and add 1 since some months have 29, 30 or 31 depending on leap years.

The end result would be something like this:

Mon: 0813

Tue: 0814

Wed: 0815

Thu: 0816

Fri: 0817

Any suggestions to point me in the right direction?

  • 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-09T17:46:26+00:00Added an answer on June 9, 2026 at 5:46 pm

    Looks like you want something like this. I am not entirely sure. This is in C#, I assume you can convert it to VB.NET.

    var folderName = @"C:\Temp\Textfiles\20120813"; //Test input
    var dateString = folderName.Substring(folderName.Length - 8);
    var date = DateTime.ParseExact(dateString, "yyyyMMdd", CultureInfo.InvariantCulture);
    
    var counter = date.DayOfWeek; //OP says this is always a Monday, but is not hardcoded
    var mmdd = int.Parse(folderName.Substring(folderName.Length - 4));
    var myDates = new List<string>();
    
    do
    {
      myDates.Add(string.Format("{0}: {1:0000}", counter.ToString().Substring(0, 3), mmdd++)); //E.g. "Mon: 0813"
    } while (counter++ < DayOfWeek.Friday);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, I have this program to sparse code in Newick Format, which extracts both
Alright, probably not the best title, but meh. I have the following code inside
Alright as I have been asking the last couple days and inching closer and
Alright, so I have this collision detection code, and I'm trying to push the
Is it OK to have the following code in my constructor to load an
Lets say I have the following code: public class Collection implements CollectionInterface{ ElementInterface[] elementArray
Alright, this problem seems to be way above my head! I have this code:
Alright, so I have a base class which we'll call TFruit . From this
Alright, I have the following: wchar_t **filePathList; This holds a list of files that
I have a question regarding the following code: abstract class a { public static

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.