To format date into day hour and minute in c#

Jitendrasoft09
Posted by Jitendrasoft09 under C# category on | Points: 40 | Views : 672
using System;

class JkExample {

static void Main(string[] args) {

TimeSpan myDuration = new TimeSpan(14, 3, 2, 0);

string customRep = myDuration.ToString("ddd' days, 'hh' hours and 'mm' minutes'");

Console.WriteLine("Custom format: {0}", customRep);


Console.ReadLine();
}
}

Comments or Responses

Login to post response