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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:36:29+00:00 2026-06-17T18:36:29+00:00

Im desperately trying to convert the following String to a Date. I did research

  • 0

Im desperately trying to convert the following String to a Date.
I did research on how to do this, but was not able to do it successfully.

So basically, I have two Datepicker-Controls on my form.
When the form is being saved, I always want to have the Date from Control #1, but keep the Time from Control #2.
I am trying as following:

Dim strDatum As String = dtpDatum.Value.ToString() '= 03.01.13 00:00:00
Dim strStart As String = dtpVon.Value.ToString()   '= 23.01.13 10:39:01
Dim sStartDatum = Strings.Left(strDatum, 8) & " " & Strings.Mid(strStart, 10, 9) '= 03.01.13 10:39:01

'here I'm trying to convert my new String to a Date and assign it to my a parameter
.Parameters("@dStartZeit").Value = DateTime.ParseExact(sStartDatum, "DD.MM.YY HH:mm:ss", New Globalization.CultureInfo("en-US"))

I get an “FormatException” when executing my query.

What am I doing wrong here?

Thanks!

  • 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-17T18:36:30+00:00Added an answer on June 17, 2026 at 6:36 pm

    Custom format strings are case-sensitive. Try:

    DateTime.ParseExact(sStartDatum, "dd.MM.yy HH:mm:ss", New Globalization.CultureInfo("en-US")`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've desperately tried to figure this out on my own, and did not want
I'm desperately trying to solve this one. I have a bunch of files stored
I am playing with things here above my head but am desperately trying to
I'm trying desperately to design my UI programmatically. But I think I'm in trouble
Right now I'm trying desperately to get @font-face to work in my website. This
I'm desperately trying to avoid a for loop in Matlab, but I cannot figure
I'm desperately trying to search the following: <texit info> author=MySelf title=MyTitle </texit> and replace
I'm desperately trying to solve this problem: Only a ACTION_DOWN event triggers my method.
I am desperately trying to develop with RIA services, but I want the User
I am desperately trying to install Hubris but the installation fails whenever I run

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.