C# 14 Working with DateTime in C#.

18
2



Learn C#. C# Tutorial. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#. Working with DateTime in C#.

Nguồn:https://wijstaanvooronzegrondrechten.org/

Xem Thêm Bài Viết Khác:https://wijstaanvooronzegrondrechten.org/cong-nghe

18 COMMENTS

  1. I have a situation below1. I have a string as "08232019", I need to convert it into DateTime(not string) format as yyyy-MM-dd2. I have a string as "08/23/2019" I need to convert it into DateTime(not string) format as yyyy-MM-ddSolution will be appreciated

  2. Sir, for creating an object we always use new keyword in c#. But here for DateTime you have not used new keyword. You have just used DateTime.Now. so please guide me why we are not using the new keyword for creating an object for this class.

  3. Thank you very much! But, how to take a date Input from a user through the console application? Please, help.

  4. nice tutorial. very helpful. i found total number of days,hours and mins. is there function to calculate total months and total year ?? can you please help in making same thing in windows application form ??

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace birth
    {
        class Program
        {
            static void Main(string[] args)
            {
                DateTime myBirth = DateTime.Parse("06/10/1989");
                TimeSpan myAge = DateTime.Now.Subtract(myBirth);

                
                Console.WriteLine("number of days = {0} days ",myAge.TotalDays);
                Console.WriteLine("number of hours  =  {0} Hours ", myAge.TotalHours);
                Console.WriteLine("number of minutes  =  {0} mins ", myAge.TotalMinutes);
                Console.ReadLine();

            }
        }
    }

LEAVE A REPLY

Please enter your comment!
Please enter your name here