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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:43:00+00:00 2026-05-17T19:43:00+00:00

For example: Dim testdate As String = 29/10/2010 testdate = Convert.ToDateTime(testdate.ToString) Response.Write(testdate) expecting 29/10/2010

  • 0

For example:

Dim testdate As String = "29/10/2010"
testdate = Convert.ToDateTime(testdate.ToString)
Response.Write(testdate)

expecting “29/10/2010 00:00:00” what I get is “29/10/2010”

  • 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-17T19:43:00+00:00Added an answer on May 17, 2026 at 7:43 pm

    The big problem is, as mentioned in other posts, you are implicitly assigning the DateTime result of the Convert operation to a string variable. This wouldn’t even pass the compilier in C#, so your into the realm of how VB operates on these implicit assignments and you probably don’t want to be there because if some part of the language specification changes in a new Framework version and you try to migrate your code, you could potentially have a nasty bug to try to find (maybe not as important here, but in other cases, yes). Best move would be to rewrite the code block to have the Convert operation assign to a DateTime object, but simplier solution would be to throw a .ToString() at the end of the Convert.ToDateTime(testdate) line (i.e. testdate = Convert.DateTime(testdate).ToString() which will leave testdate with the date and the timestamp formatted to the current culture (as you are now performing an explicit conversion between the DateTime and the destination String).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example, I write a method: Private Sub Command1_Click() Dim dom As New DOMDocument
I would like to get the name of a property, for example: Dim _foo
I'm trying to convert a mathematical result of money format example: Dim num1 As
Example code: Dim a As String a = 1234,5678,9123 I want to add literal
For example Dim aInt as Integer should have the value as nothing instead of
how do start/stop services using net stop command in c# for example Dim pstart
I'm trying to store the names of some variables inside strings. For example: Dim
I'd like to create a list of an anonymous type, for example: Dim lineItem
I've tried this example directly from MSDN: Dim Screens() As System.Windows.Forms.Screens and I can't
What should be the parameter for CreateObject ? See this example: Dim a Set

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.