Solved

vbnet convert string to time value

Posted on 2011-03-04
4
545 Views
Last Modified: 2012-05-11
Hi,
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
0
Comment
Question by:Soluga
  • 2
  • 2
4 Comments
 
LVL 19

Expert Comment

by:Bardobrave
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:

http://msdn.microsoft.com/en-us/library/s2dy91zy%28v=vs.80%29.aspx
0
 
LVL 1

Author Comment

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

Accepted Solution

by:
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
0
 
LVL 1

Author Closing Comment

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

Thanks
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
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…

809 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