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 201 views
2 answers 216 views
1 answer 169 views
3 answers 240 views
1 answer 164 views
1 answer 140 views
2 answers 136 views
...