You can use the version of ToString that takes a format, i.e.
int i = int.Parse(d.ToS tring("dhhmmss" ));
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
nntp://news.microsoft. com/microsoft.publi c.dotnet.langua ges.csharp/<AD************ *************** *******@microso ft.com>
Suppose it's Oct. 2, 2004 and time is 03:01:27.
I need a number (integer) that is in this form:
days hours minutes seconds
Using the example, the number will be:
2030127
Right now, I'm converting DateTime.Now to strings, concatenating them and
converting back to an integer:
"2" + "03" + "01" + "27"
Is there an easier way to do this?
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 28/09/2004
[microsoft.publi c.dotnet.langua ges.csharp]