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

  • Home
  • SEARCH
  • 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 6706659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:32:47+00:00 2026-05-26T07:32:47+00:00

Short question. I am trying to convert a string into Date (to put it

  • 0

Short question. I am trying to convert a string into Date (to put it later into INSERT command). My problem is that the string I am reading is always different (there is no rule what format it is going to be – as this is user-dependent).

I found such piece of code on the stackoverflow:

DateTime myDate = 
    DateTime.ParseExact("2009-05-08 14:40:52,531", 
                        "yyyy-MM-dd HH:mm:ss,fff",
                        System.Globalization.CultureInfo.InvariantCulture)

but in my case it will not work as I don’t know what kind of format I am going to import.
Is there any universal import function which checks all known formats? If now how should I write it? (please give me some hints).

Thanks for any tips and hints in advance,
Pete

  • 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-26T07:32:47+00:00Added an answer on May 26, 2026 at 7:32 am

    No this is not possible however you may define possible formats in an array and pass it to ParseExact or TryParseExact method.

    Dim format() As String = {"dd-MM-yy", "dd/MM/yy"}
    
    Dim myDate As DateTime = DateTime.ParseExact("2009-05-08 14:40:52,531",format, 
                          System.Globalization.CultureInfo.InvariantCulture))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Terribly worded question above (trying to be short). Lets try that again: In Microsoft
Short question: Is the parent of an entity group included in that entity group
Short question. How do you go about transposing UML diagrams into code? The class
This is a short question. At some point my thread understand that it should
I have a short question. Im my current project I'm using LINQ-to-SQl. That is
Short Question: Basically I am trying to add a scalar property to my entity
Short Question Is there a library that is supposed to replace mswinsoc.osx used to
I'm trying to redirect requests that have a query string to a different domain
I am trying to understand trigonometry and the short answer is that I do
I'm trying to read into R a csv file that contains information on political

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.