public String FechaToTextSQL(DateTime Fecha) { String strD = LeftRightMid.Right("0" + Fecha.Day.ToString(), 2); String strM = LeftRightMid.Right("0" + Fecha.Month.ToString(), 2); String strY = Fecha.Year.ToString(); return(strY + strM + strD); }
private int secondsSinceMidnight() { string tmpStr = DateTime.Now.ToString("HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture); int hour = Convert.ToInt32(LeftRightMid.Left(tmpStr, 2)); int mins = Convert.ToInt32(LeftRightMid.Mid(tmpStr, 3, 2)); int secs = Convert.ToInt32(LeftRightMid.Right(tmpStr, 2)); int secsSinceMidnight = (hour * 3600) + (mins * 60) + secs; return(secsSinceMidnight); }