By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,219 Members | 2,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,219 IT Pros & Developers. It's quick & easy.

Format time

P: n/a
If I try:
? format(0.1225,"hh:mm:ss")

I should get : 02:56:24

but I don't.

Which is the right function now in .NET?

Thank you,

Simon

Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Have a look at string.format(). In the help section it will list the DateTimeFormatEnum or something like that (VS takes a bit to start up right now). And that will give you a list. I think you can even use

format(0.1225, "Medium Time") but thats some old vb6 stuff covered in the Microsoft.VisualBasic.dll

-CJ

"simon" <si*********@stud-moderna.si> wrote in message news:OT**************@TK2MSFTNGP15.phx.gbl...
If I try:
? format(0.1225,"hh:mm:ss")

I should get : 02:56:24

but I don't.

Which is the right function now in .NET?

Thank you,

Simon

Nov 21 '05 #2

P: n/a
Simon,

Before Jay B has to write that he always forget this (FromDays).

Dim result As String = TimeSpan.FromDays(0.1225).ToString

(Just to show you that with this I have always to think about you Jay)

:-)

Cor
Nov 21 '05 #3

P: n/a
* "simon" <si*********@stud-moderna.si> scripsit:
If*I try:

? format(0.1225,"hh:mm:ss")

I should get : 02:56:24

but I don't.


'Date.ToString'

+

Date and Time Format Strings
<URL:http://msdn.microsoft.com/library/en-us/cpguide/html/cpconDateTimeFormatStrings.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.