fromDateTime() public static method

Convert DateTime into VistA format
public static fromDateTime ( System.DateTime t ) : String
t System.DateTime
return String
Ejemplo n.º 1
0
        public void TestPrecisionPositions()
        {
            string testDate = VistaTimestamp.fromDateTime(new DateTime(2008, 01, 23, 12, 34, 56, 789));

            Assert.AreEqual("308", testDate.Substring(0, (int)VistaDateTimeIterator.PRECISION.YEAR));
            Assert.AreEqual("30801", testDate.Substring(0, (int)VistaDateTimeIterator.PRECISION.MONTH));
            Assert.AreEqual("3080123", testDate.Substring(0, (int)VistaDateTimeIterator.PRECISION.DAY));
            Assert.AreEqual("3080123.12", testDate.Substring(0, (int)VistaDateTimeIterator.PRECISION.HOUR));
            Assert.AreEqual("3080123.1234", testDate.Substring(0, (int)VistaDateTimeIterator.PRECISION.MINUTE));
            Assert.AreEqual("3080123.123456", testDate.Substring(0, (int)VistaDateTimeIterator.PRECISION.SECOND));
        }
Ejemplo n.º 2
0
 public string GetDdrListerPart()
 {
     return(VistaTimestamp.fromDateTime(IterStartDate).Substring(0, _precision));
 }