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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:48:50+00:00 2026-05-16T02:48:50+00:00

I have a date string in format 08/1999 I want to get the first

  • 0

I have a date string in format “08/1999” I want to get the first date of the corresponding month. eg : in this case 08/01/1999.
It is simple for en-Us culture. I break the string, append “01” in the string to get 08/01/1999 and then DateTime.Parse(datestring) but this is valid for en-US culture only.

How can I do this for different culture ?

My datestring will always be in mm/yyyy format. and I am trying to obtain a DataTime obj from this dateString.

  • 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-05-16T02:48:50+00:00Added an answer on May 16, 2026 at 2:48 am

    Use ParseExact method. Note upper-cased M’s are for months and lower-cased m’s for minutes.

    string dateToConvert = "08/1999";
    string format = "MM/yyyy";
    CultureInfo provider = CultureInfo.InvariantCulture;
    
    DateTime result = DateTime.ParseExact(dateToConvert, format, provider); 
    

    Output:

    {1999-08-01 00:00:00}
    

    You can also use Convert.ToDateTime and Parse methods. It will produce the same result, but in implicite way:

    DateTime result = Convert.ToDateTime(dateToConvert, provider); // Output: {1999-08-01 00:00:00}
    DateTime result = DateTime.Parse(dateToConvert, provider); // Output: {1999-08-01 00:00:00}
    

    Read more at:

    • Parsing Date and Time Strings
    • Standard Date and Time Format Strings
    • Custom Date and Time Format Strings
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a little blockheaded right now… I have a date string in european format
I have a string containing a date, and another string containing the date format
I have a String representation of a date that I need to create a
I have a string that contains the representation of a date. It looks like:
I have a string from an email header, like Date: Mon, 27 Oct 2008
I have a date variable as 24-dec-08 . I want only the 08 component
For PHP I have a date I want line wrapped. I have $date =
I have a date and time column in my mysql table called start_date and
If I have a date, how do I calculate the week number for that
I am working on a project where the requirement is to have a date

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.