Insert Date and Time into Access
程序员文章站
2023-11-17 21:06:10
<% function accessdatetime (dateandtime) dim myday dim my...
<%
function accessdatetime (dateandtime)
dim myday
dim mymonth
dim myyear
myday = day(dateandtime)
if len(myday)=1 then myday="0" & myday
mymonth = month(dateandtime)
if len(mymonth)=1 then mymonth="0" & mymonth
myyear = year(dateandtime)
accessdatetime = myyear & "-" & mymonth & "-" & myday & " " & time()
end function
dim connection
dim sql, sconnstring
sql="insert into tbldate (ddate) values (#" & accessdatetime(now()) & "#)"
sconnstring="provider=microsoft.jet.oledb.4.0;" & _
"data source=" & server.mappath("datedb.mdb")
set connection = server.createobject("adodb.connection")
connection.open(sconnstring)
connection.execute(sql)
connection.close
set connection = nothing
%>
function accessdatetime (dateandtime)
dim myday
dim mymonth
dim myyear
myday = day(dateandtime)
if len(myday)=1 then myday="0" & myday
mymonth = month(dateandtime)
if len(mymonth)=1 then mymonth="0" & mymonth
myyear = year(dateandtime)
accessdatetime = myyear & "-" & mymonth & "-" & myday & " " & time()
end function
dim connection
dim sql, sconnstring
sql="insert into tbldate (ddate) values (#" & accessdatetime(now()) & "#)"
sconnstring="provider=microsoft.jet.oledb.4.0;" & _
"data source=" & server.mappath("datedb.mdb")
set connection = server.createobject("adodb.connection")
connection.open(sconnstring)
connection.execute(sql)
connection.close
set connection = nothing
%>
推荐阅读
-
PHP中time(),date(),mktime()区别介绍
-
Insert Date and Time into Access
-
pandas 快速处理 date_time 日期格式方法
-
时间计算工具Advanced Date Time Calculator激活教程
-
Linux中date命令转换日期提示date: illegal time format问题解决
-
使用 MySQL Date/Time 类型
-
PHP中time(),date(),mktime()区别介绍
-
time(),date(),microtime()三者的区别
-
time(),date(),microtime()三者的区别
-
Insert Date and Time into Access