public void FormatTimestampはDefaultTimestampFormatで取得できる書式で日時を文字列に変換する() { // setup DateTime dateTime = new DateTime(2012, 1, 1, 1, 1, 2); // expect Assert.AreEqual("2012-01-01 01:01:02", Formi.FormatTimestamp(dateTime)); }
public virtual string ToString(object obj) { if (obj == null) { return(""); } else if (obj is string) { return((string)obj); } else if (obj is DateTime) { return(Formi.FormatTimestamp((DateTime)obj)); } else if (obj is IEnumerable) { return(IEnumerableToString((IEnumerable)obj)); } else { return(obj.ToString()); } }