Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:时间戳疑问

1楼
ljh29206 发表于:2024/4/27 10:59:00
 请教下

dim startTime as date = CDate(Date.Today & " " & "08:00")

就是 : "2024-04-27 08:00:00"

Dim st As Date = "1970-01-01 00:00"
Dim t As TimeSpan
t = startTime - st
MessageBox.Show(t.TotalMilliseconds)

输出的结果 是 1714204800000  ,



data.time 的传值 
通过  foxtable代码传值  数值为  CDate(Date.Today & " " & "08:00")
就是 : "2024-04-27 08:00:00"

网页上 通过 getTime()  取值.

在 网页上的输出结果 是 1714176000000  这个数值 应该是正确的.

在foxtable  与   网页上  这2个结果 对不上 ,  是 什么原因呢,请教是需要 做 加减 转换吗?


var date1 = new Date(data.time);
var startTime = new Date(date1).getTime();
console.log(date1);

[此贴子已经被作者于2024/4/27 11:00:01编辑过]
2楼
有点蓝 发表于:2024/4/27 11:57:00
要考虑到时区的,应该使用这

Dim st As Date = "1970-01-01 08:00"
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01563 s, 2 queries.