Link to home
Start Free TrialLog in
Avatar of piratepatrol
piratepatrolFlag for United States of America

asked on

FormatDateTime in C#

Hi everyone,

I feel dumb for asking this, but I'm having a hard time locating stuff on the web showing me a C# equivalent of VB's FormatDateTime function.  I really like how

MsgBox(FormatDateTime("07:30", vbLongTime))           produces "7:30:00 AM" in VB.  

Can C# achive this in one line, or must there be an elaborate scheme to imitate this VB function?

Thank you so much,


Jazon
Avatar of ptmcomp
ptmcomp
Flag of Switzerland image

DateTime.Parse("07:03").ToString("T");
ASKER CERTIFIED SOLUTION
Avatar of ptmcomp
ptmcomp
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of piratepatrol

ASKER

Thank you so much!