以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]日期常量无效 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=91073) |
-- 作者:铜豌豆之首 -- 发布时间:2016/9/28 17:19:00 -- [求助]日期常量无效 Dim dt As Date = Date.Today Dim dt1 As Byte = dt.Year Dim dt2 As Date = #01/01/ & dt1 & # Dim dt3 As Date = dt2.AddYears(1) Output.Show(dt3)
|
-- 作者:有点蓝 -- 发布时间:2016/9/28 17:28:00 -- Dim dt2 As Date = new date(dt.Year,1,1) |
-- 作者:铜豌豆之首 -- 发布时间:2016/9/28 17:54:00 -- 怎么计算两日期相差天数出错 Dim dt As Date = Date.Today Dim dt2 As Date = new Date(dt.Year,1,1) Dim dt3 As Date = dt2.AddYears(1) Dim dt4 As Short = DateYMD(dt3,dt,,,d) 其实 我最终的目的是 想通过某单元格日期 计算今年剩余天数 谢谢
[此贴子已经被作者于2016/9/28 17:55:13编辑过]
|
-- 作者:有点蓝 -- 发布时间:2016/9/28 18:03:00 -- Dim d As Date = new Date(Date.Today.Year,12,31) Output.Show(d.DayOfYear) Output.Show(d.DayOfYear - Date.Today.DayOfYear)
|