vbnet convert string to time value

Posted on 2011-03-04
Last Modified: 2012-05-11
I am using a MSChart control and want to represent a time value, the problem is the value ie 0000:0:26 is in a string format, how can I convert this into a numerical format to it can be used in the chart?

Many Thanks
Question by:Soluga
  • 2
  • 2
LVL 19

Expert Comment

ID: 35035371
You should manipulate your string to a valid date format and then use a date conversion function.

Check cDate function here for further info:

Author Comment

ID: 35035641
Yeah, I have tried that, but it just says error converting string.
LVL 19

Accepted Solution

Bardobrave earned 500 total points
ID: 35035688
Probably because a format like 0000:0:26 is not supported as a date string. This is why I tell you that you need to manipulate your string. You need to convert it to a valid date format before calling the date conversion function.

You can see a list of valid date string formats on the above link

Author Closing Comment

ID: 35036475
Yep OK, I will probably just convert into a double or a decimal.


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
A short film showing how OnPage and Connectwise integration works.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now