算算你的时间差

  

<span style="font-family: FangSong_GB2312; font-size: 18px;">Dim t1 As DateTime = Date.FromOADate(2016 / 4 / 8)
        Dim t2 As DateTime = Now
        Dim ts As TimeSpan
        ts = t2 - t1
        span.Text = ts.Minutes.ToString

        'https://www.microsoft.com/china/vbscript/vbslang/vsfctDateDiff.htm
        '用“y”,"m","d","h","n","s"
        '分别表示 "年""月""日""时""分""秒"
        diff.Text = DateDiff("n", t1, Now).ToString

        'http://bbs.csdn.net/topics/390503925
        TextBox1.Text = (DateDiff(DateInterval.Minute, t1, Now) Mod 60)
        '倒数第二个
        TextBox2.Text = (DateTime.UtcNow - New DateTime(2016, 4, 8)).TotalMinutes.ToString
        '倒数第一个
        TextBox3.Text = t2.Subtract(t1).TotalMinutes.ToString
</span>

结果显示:



算算你的时间差_第1张图片

你可能感兴趣的:(算算你的时间差)