Solved

vbnet convert string to time value

Posted on 2011-03-04
4
542 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

759 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

16 Experts available now in Live!

Get 1:1 Help Now