- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我创建了一个应用程序来在达到目标日期和时间后显示新闻稿,我想知道这是从服务器还是客户端获取时间,因为我想使用服务器的时间以便有人不只是为了看到它而改变他们的时钟。
这是我的代码:
<%
dim strDate
dim strTime
dim strTarget_time
dim strTarget_date
dim strBreak
dim strRuleBreak
dim strToday
strDate = Date()
strTime = Time()
strright_now = Now()
strTarget_time = "3:27:00 PM"
strTarget_date = "6/26/2012"
strBreak = "<br />"
strRuleBreak = "<br /><hr><br />"
strToday = Now()
response.write("<h2>TEST VARIABLES</h2>")
response.write("<p><strong>Today's date:</strong> " & strDate & strBreak)
response.write("<strong>Current time:</strong> " & strTime & strBreak)
response.write("<strong>Target date:</strong> " & strTarget_date & strBreak)
response.write("<strong>Target time:</strong> " & strTarget_time & "</p>")
response.write(strRuleBreak)
'TIME TESTER
response.write("<h2>TIME TESTER</h2>")
response.write("<p><nobr>Testing to see if it is past the target time of: " & strTarget_time & "</nobr></p>")
if strTime >= cdate(strTarget_time) then
response.write("<p>Yes, it is now " & Now() & ", which <strong>IS</strong> past the target time of: " & strTarget_time & "</p>")
else
response.write("<p>No, it is now " & Now() & ", which is <strong>NOT</strong> past the target time of: " & strTarget_time & "</p>")
end if
response.write(strRuleBreak)
'DATE TESTER
response.write("<h2>DATE TESTER</h2>")
response.write("<p><nobr>Testing to see if it is past the target date of: " & strTarget_date & "</nobr></p>")
if strToday >= cdate(strTarget_date) then
response.write("<p>Yes, it is now " & Now() & ", which <strong>IS</strong> past the target date of: " & strTarget_date & "</p>")
else
response.write("<p>No, it is now " & Now() & ", which is <strong>NOT</strong> past the target date of: " & strTarget_date & "</p>")
end if
response.write(strRuleBreak)
'DATE AND TIME TESTER
response.write("<h2>DATE AND TIME TESTER</h2>")
response.write("<p><nobr>Testing to see if it is past the target of: " & strTarget_date & " - " & strTarget_time & "</nobr></p>" & strBreak)
if strToday >= cdate(strTarget_date) AND strTime >= cdate(strTarget_time) then
response.write("<p>Yes, it is now " & Now() & ", which <strong>IS</strong> past the target of: " & strTarget_date & " - " & strTarget_time & "</p>")
else
response.write("<p>No, it is now " & Now() & ", which is <strong>NOT</strong> past the target of: " & strTarget_date & " - " & strTarget_time & "</p>")
end if
response.write(strRuleBreak)
%>
所以在这种情况下,如果时间和日期是 AFTER 6/26/2012 3:27 PM,那么该部分将显示。我问的主要是因为我想澄清这是使用客户端还是服务器端时间。
最佳答案
这将是服务器端,因为这是执行 ASP 代码的地方。为了获取客户端日期时间,您需要使用脚本在浏览器中运行 - 通常是 JavaScript。
关于asp-classic - 使用 VBScript 和 ASP Classic 的服务器时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11227565/
我想知道是否有人可以帮助我,因为我对我认为导致简单错误的简单原因视而不见。 我有这个代码: doRound1(x1) denom1 = 5 y1 = denom1 - x1 mod deno
我有以下代码,注释详细说明了会发生什么: averageNum = myArray2(0) 'assign variable response.write(TypeName(averageNum)&"
我有以下脚本,它在本地运行良好(Windows 10 IIS、Windows 2003 Server),但不适用于我们的托管服务器(Windows 2003 Server)。任何超过 4mb 的下载都
ASP Classic 是否具有等同于 PHP 的“包含一次”功能的功能? 最佳答案 我知道这是一个古老的话题,但我想如果有人感兴趣,我会加上我的两分钱。 我编写了一个函数,它完全符合您的要求:无论调
我在Windows 7中运行IIS 7.5,并且已经进入“打开或关闭Windows功能”并在“Internet信息服务/万维网服务/应用程序开发功能”中启用了ASP。一旦做完,我开始收到一个HTTP
我正在尝试从 MS Access 数据库创建一个 ID(主键和自动增量)以用作登录密码。但我收到此错误: Microsoft OLE DB Provider for ODBC Drivers erro
我已经为 Classic ASP(VBScript) + firephp 编写了一个开源调试类,想知道是否可以获取传递给函数的变量的名称?我进行了搜索,但似乎找不到任何技巧来执行此操作。 例子 代码:
我正在尝试从 MS Access 数据库中创建一个 ID(主键和自动增量)以用作登录密码。但是我收到了这个错误: Microsoft OLE DB Provider for ODBC Drivers
我有一个结帐表格,其中产品的数量可以是“n”。那么我如何知道表单中有多少输入字段并从中获取输入呢? 谢谢 最佳答案 如果它是一组单个控件 - 比如说代表项目的可变数量的复选框 - 解决方案非常简单。对
我刚刚审查了一些旧代码并发现了以下内容(在 foo.asp 中): Const ASP_FILENAME = "foo.asp" ' TODO: Update this to the name of
关注 my last question有谁知道如何在经典 ASP 的应用程序范围内使用字典对象?您不能使用 Scripting.Dictionary - 如果您尝试使用,您将看到类似以下内容: App
我的意思是,像 php'h 包括... 就像是 my_file_to_be_included = "include_me.asp" --> 就我目前所见,有几种选择,但每一种都有某种缺点......
我在哪里可以找到“经典”ASP 代码的编辑器? 最佳答案 如果我要进行大量更改,我总是使用 VS2008(支持智能感知、高亮显示和来自 SP1 的调试),Notepad2对于快速(没有智能感知,只有突
例如,我如何运行下面的 me.test? myvar = 'test' me.myvar ASP 查找方法“myvar”但没有找到。在 PHP 中我可以简单地说 $me->$myvar 但 ASP 的
这是要点: 我有一个我想用asp打的电话,我不关心响应。我只想触发调用,我不希望页面等待响应。根据文档,它应该看起来像这样: dim xmlhttp : set xmlhttp = Server.Cr
示例代码: Dim myObject Set myObject = JSON.parse(someJsonResponseFromTheServer) myFunction(myObject.s
据我所知,VBScript/Classic ASP 中唯一的预处理指令是#include。我不知道这是否是正式名称,但我基本上是在寻找可以在通用 VBScript 之前执行代码或其他指令的代码。 VB
据我所知,VBScript/Classic ASP 中唯一的预处理指令是#include。我不知道这是否是正式名称,但我基本上是在寻找可以在通用 VBScript 之前执行代码或其他指令的代码。 VB
我必须维护一个 ASP 3.0 网站... 我想保护sql语句。 我可以使用此代码保护的选择语句: set cmd = Server.createObject("adodb.command") cmd
我正在使用 WebMatrix 中托管的经典 ASP Web 应用程序。有没有办法调试托管在 WebMatrix 中的网站? 最佳答案 WebMatrix 通过调试工具提供很少(没有)。您可以 Res
我是一名优秀的程序员,十分优秀!