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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL ( and MongoDB (…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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