How to extract and display the minutes from DateTime in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            DateTime now = DateTime.Now;

            string minutes = now.ToString("m ");

            Console.WriteLine($"{minutes}");
        }
    }
}


/*
run:
 
50

*/

 



answered Aug 14, 2018 by avibootz

Related questions

2 answers 196 views
2 answers 206 views
1 answer 161 views
3 answers 232 views
1 answer 158 views
1 answer 133 views
2 answers 131 views
...