What is the string format options for second in DateTime with C#

1 Answer

0 votes
using System;
  
public class Program
{
    public static void Main()
    {
        DateTime dt = new DateTime(2004, 03, 06, 14, 30, 07);
  
        string s = String.Format("{0:s ss}", dt);  
          
        Console.WriteLine(s);
    }
}
  
  
  
  
/*
run:
  
7 07
  
*/

 



answered Mar 27, 2022 by avibootz

Related questions

...