Thursday, February 20, 2003

C# format strings: See the nutshell book

DateTime t = System.DateTime.Now;
file.WriteLine(
"{0:00}{1:D2}{2:D2} {3:D2}:{4:D2}:{5:D2}+{6:D4} {7}",
t.Year-2000, // Y21K!
t.Month, t.Day, t.Hour, t.Minute,
t.Second, t.Millisecond, s );

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?