In the previous post, I mentioned how to convert DATETIME to TIMESPAN.
Now if the requirement is to convert DATETIME TO TIMESPAN, we can do that in one line:
DateTime dt="XXX";
TimeSpan TS = new TimeSpan(dt.Now.Ticks);
This will convert the DateTime to TimeSPan.
Varun
15 comments:
Extrapolating from the above suggestion, wouldn't this work:
Dim dtStartTime as new DateTime
Dim tsStartTime As TimeSpan = New TimeSpan(dtStartTime.Hour, dtStartTime.Minute, dtStartTime.Second)
Since TimeSpan takes hours, minutes, and seconds as arguments.
Nice blog.. Thanks for sharing this blog information with us…
This does not work. Now is not a valid property on an instance of a DateTime.
Totally nonsense! This converts apples to potatoes.
TimeSpan and DateTime are there because a date is a completely different thing than a time span: What date should "one week and five hours" be???
Really Nice Information,Thank You Very Much For Sharing.
Web Development Company
thank you for sharing such a nice and interesting blog with us. hope it might be much useful for us. keep on updating...
SEO Company In Chennai
very nice and informative blog
big data projects chennai
mobile computing projects chennai
cloud computing projects chennai
secure computing projects chennai
Thanks for sharing this valuable information.
dotnet projects in chennai
This was so useful and informative. The article helped me to learn something new. Android App Development Company in Chennai
This idea is mind blowing. I think everyone should know such information like you have described on this post. Thank you for sharing this explanation.Your final conclusion was good. We are sowing seeds and need to be patiently wait till it blossoms.
Architectural Firms in Chennai
Architects in Chennai
It’s really amazing that we can record what our visitors do on our site. Thanks for sharing this awesome guide. I’m happy that I came across with your site this article is on point,thanks again and have a great day. Keep update more information..
Dot Net Training in Chennai
Software Testing Training in Chennai
I do trust all of the concepts you’ve presented on your post. They’re really convincing and will definitely work. Still, the posts are too brief for newbies. May you please extend them a little from subsequent time?Also, I’ve shared your website in my social networks.
Best Architects in Chennai
Turnkey Interior Contractors in Chennai
Interior Contractors in Chennai
Architecture Firms in Chennai
Best Interior Designers in Chennai
I read so many articles in your blog. All are awesome. I learnt a lot of new things with help of your blog. Thanks for sharing this wonderful information.
Best website developers in bangalore
Website designers in Bangalore
Best ECommerce Website developers in bangalore
Outsource magento ecommerce services india
Fertility is the natural capability to produce offspring. As a measure, fertility rate is the number of offspring born per mating pair, individual or population.Human fertility depends on factors of nutrition, sexual behavior, consanguinity, culture, instinct, endocrinology, timing, economics, way of life, and emotions.Greate thinks of a fertility center for humans.
Fertility Center in OMR
Post a Comment