CSharp examples for System:DateTime Minute
This method returns a two digit minute for the date given.
using System.IO;//from w w w.j a v a2s . c o m using System.Text; using System.Linq; using System.Collections.Generic; using System; public class Main{ #endregion #region GetTwoDigitMinute(DateTime date) /// <summary> /// This method returns a two digit minute for the date given. /// </summary> /// <param name="date"></param> /// <returns></returns> public static string GetTwoDigitMinute(DateTime date) { // initial value string twoDigitMinute = ""; // set the twoDigitMinute twoDigitMinute = date.Minute.ToString(); // if the Length is less than two if (twoDigitMinute.Length < 2) { // prepend a zero to the Minute twoDigitMinute = "0" + date.Minute.ToString(); } // return value return twoDigitMinute; } }