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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:57:16+00:00 2026-06-10T23:57:16+00:00

I have some date returned from FTP server like this Aug 28 11:03 Aug

  • 0

I have some date returned from FTP server like this

Aug 28 11:03
Aug 28 18:06
Sep  6 16:03

Im using this code to parse the time

CultureInfo provider = new CultureInfo("en-US");
_fileDateTime = DateTime.ParseExact(timestring, "MMM dd H:mm", provider);

The first two date work, but the last won’t. Does any one have better ideas in parsing these kind of date format?

MMM d H:mm will work with Sep 6 16:03 but in my case its Sep 6 16:03 will not work, note the double space between Sep and 6

  • 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-10T23:57:17+00:00Added an answer on June 10, 2026 at 11:57 pm

    There are multiple issues, one is which is already pointed out in other answers i.e. using single d for date since last date is 6 not 06. The other problem with the last date is that it has multiple spaces in between date and month because of that your format which is taking care of dates with single space is not working. You need to first remove the extra space and then parse using format with single d. Try the following code:

        string timestring = "Sep  6 16:03";
       //string[] array = timestring.Split(" ".ToCharArray(),StringSplitOptions.RemoveEmptyEntries);
       //timestring = string.Join(" ", array);
        timestring = System.Text.RegularExpressions.Regex.Replace(timestring, @"\s+", " ");
    
        CultureInfo provider = new CultureInfo("en-US");
        DateTime _fileDateTime = DateTime.ParseExact(timestring, "MMM d H:mm", provider);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data, like this: BUG DATE STATUS ---- ---------------------- -------- 9012 18/03/2008
I have some date and I want to get last x day before this
I have some code which builds an array of date ranges. I then call
I am using notepad++ to do some date conversions but have run into a
I have tried using date(m/d/Y, strtotime(04-05-2012)) but I will get 05/04/2012 or on some
I have some code that reads a datetime from a sqlite database, the datetime
I have asked aqbout timezones and date/time before but this is a more specific
I have some text in the following format: column1 DATE, column2 VARCHAR2(6), column3 VARCHAR2(15)
If I have a field in a table of some date type and I
Is it possible in javascript to convert some date in timestamp ? i have

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.