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 have a date in String format, mm/dd/yyyy I want to convert this to
I have a date in this string format 02/28/2012 and I want to convert
I have date in this format 1999-05-31T13:20:00.000-05:00 I want to add some hours or
I have date time information in this format: String reportDate=2012-04-19 12:32:24; I want to
i want to format date to string in hql select, for example i have
I have javascript date object which gives me a date string in this format,
I have a date string that looks like the following javascript format. I want
I have a date string in this format - DD-MM-YYYY this validates that successfully:
I have a Date with string format (For example 01/01/2013). How to I get
I have the date in the string format like this Sat Sep 8 10:13:09

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.