trimTime() public static method

Removes the time portion (if present) of a date/time string of expected format.
NOTE: this function doesn't check for well-formatted-ness of timestamp argument. If you need to check, use the isWellFormed...() functions
public static trimTime ( string timestamp ) : string
timestamp string yyyyMMdd.HHmmss or yyyyMMdd
return string
Exemplo n.º 1
0
        public void TestTrimTime_SeparatorAndTimeOnly()
        {
            string DATE_TIME = ".123456";

            Assert.AreEqual("", DateUtils.trimTime(DATE_TIME));
        }
Exemplo n.º 2
0
        public void TestTrimTime_NormalDateOnly()
        {
            string DATE_TIME = "20091123";

            Assert.AreEqual("20091123", DateUtils.trimTime(DATE_TIME));
        }