{"id":78,"date":"2011-06-09T13:16:59","date_gmt":"2011-06-09T05:16:59","guid":{"rendered":"http:\/\/iwisdomsys.com\/?p=78"},"modified":"2011-06-29T02:45:34","modified_gmt":"2011-06-28T18:45:34","slug":"asp-%e6%97%a5%e6%9c%9f%e8%aa%9e%e6%b3%95%e6%95%b4%e7%90%86","status":"publish","type":"post","link":"http:\/\/iwisdomsys.com\/?p=78","title":{"rendered":"asp \u65e5\u671f\u8a9e\u6cd5\u6574\u7406"},"content":{"rendered":"<p>\u5728\u5bebasp\u7a0b\u5f0f\u6642\uff0c\u65e5\u671f\u9577\u662f\u500b\u9ebb\u7169\uff0c\u5c24\u5176\u662f\u6488\u8cc7\u6599\u5eab\u7684\u65e5\u671f\u51fa\u4f86\u6bd4\u5c0d\uff0c\u6216\u662f\u8981\u4ee5\u67d0\u7a2e\u65e5\u671f\u683c\u5f0f\u5beb\u5165\u8cc7\u6599\u5eab\u6642\uff0c\u65e5\u671f\u683c\u5f0f\u5e38\u8981\u4f86\u8f49\u4f86\u8f49\u53bb\uff0c<strong><span style=\"color: #666699;\">\u5047\u8a2d\u73fe\u5728\u7684\u6642\u9593 Now()\u662f &#8220;2009\/7\/4 \u4e0a\u5348 12:45:36&#8243;\uff0c\u82e5\u8981\u8f49\u6210&#8221;2009\/07\/04 00:45:36&#8243;\uff0c\u8a72\u600e\u9ebc\u505a\u5462?<\/span><\/strong> \u8acb\u5148\u770b\u4e00\u4e0b\u4e0b\u6587\u4e2d\u4e00\u4e9b\u5bebasp\u7a0b\u5f0f\u6642\u5e38\u7528\u7684\u65e5\u671f\u8a9e\u6cd5\uff0c\u7b54\u6848\u5728\u6700\u4e0b\u65b9!<!--more--><\/p>\n<h2><span style=\"font-weight: bold;\">\u7cfb\u7d71\u6642\u9593<\/span><\/h2>\n<p><span style=\"color: #ff99ff; font-weight: bold;\">Date() <\/span><br \/>\n-\u53d6\u7cfb\u7d71\u65e5\u671f\u3002<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write Date()<br \/>\n\u7d50\u679c: 2009\/7\/4<\/span><\/p>\n<p><span style=\"color: red; font-weight: bold;\"><span style=\"color: #ff99ff;\">Time()<\/span> <\/span><br \/>\n-\u53d6\u7cfb\u7d71\u6642\u9593\u3002<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write Now()<br \/>\n\u7d50\u679c: <\/span><span style=\"color: red;\">\u4e0a\u5348 12:45:36<\/span><\/p>\n<p><span style=\"color: #ff99ff; font-weight: bold;\">Now() <\/span><br \/>\n-\u53d6\u7cfb\u7d71\u65e5\u671f\u6642\u9593\u3002<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write Now()<br \/>\n\u7d50\u679c: <\/span><span style=\"color: red;\">2009\/7\/4 \u4e0a\u5348 12:45:36<\/span><br \/>\n<span style=\"font-weight: bold;\"><br \/>\n<\/span><\/p>\n<h2><span style=\"font-weight: bold;\">\u65e5\u671f\u5224\u65b7<\/span><span style=\"color: red;\"><br \/>\n<span style=\"color: #ff99ff; font-weight: bold;\"> <\/span><\/span><\/h2>\n<p><span style=\"color: red;\"><span style=\"color: #ff99ff; font-weight: bold;\">IsDate(\u65e5\u671f\u6216\u5b57\u4e32) <\/span><\/span><br \/>\n-\u5224\u65b7\u662f\u5426\u70ba\u65e5\u671f\u3002<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write IsDate(Now())<br \/>\n\u7d50\u679c: True<\/span><\/p>\n<p><span style=\"color: #ff99ff; font-weight: bold;\">CDate\uff08<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u65e5\u671f\u6216\u5b57\u4e32<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\uff09<\/span><br \/>\n-\u5c07\u5b57\u4e32\u8f49\u63db\u6210\u65e5\u671f<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write CDate(Now())<br \/>\n\u7d50\u679c: <\/span><span style=\"color: red;\">2009\/7\/4 \u4e0a\u5348 12:45:36<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-weight: bold;\">\u53d6\u65e5\u671f\u6642\u9593\u503c<\/span><span style=\"color: red;\"><br \/>\n<\/span><span style=\"color: #ff99ff; font-weight: bold;\"> <\/span><\/h2>\n<p><span style=\"color: #ff99ff; font-weight: bold;\">Year(<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u65e5\u671f\u6642\u9593\u6216\u5b57\u4e32<\/span><span style=\"color: #ff99ff; font-weight: bold;\">)<\/span><br \/>\n-\u50b3\u56de\u65e5\u671f<span style=\"font-weight: bold;\">\u5e74<\/span>\u7684\u90e8\u4efd<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write Year(&#8220;<\/span><span style=\"color: red;\">2009\/7\/4 \u4e0a\u5348 12:45:36<\/span><span style=\"color: red;\">&#8220;)<br \/>\n\u7d50\u679c: <\/span><span style=\"color: red;\">2009<\/span><\/p>\n<p><span style=\"color: #ff99ff; font-weight: bold;\">Month(<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u65e5\u671f\u6642\u9593<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u6216\u5b57\u4e32)<\/span><br \/>\n-\u50b3\u56de\u65e5\u671f<span style=\"font-weight: bold;\">\u6708<\/span>\u7684\u90e8\u4efd<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write <\/span><span style=\"color: red;\">Month<\/span><span style=\"color: red;\">(&#8220;<\/span><span style=\"color: red;\">2009\/7\/4 \u4e0a\u5348 12:45:36<\/span><span style=\"color: red;\">&#8220;)<\/span><br \/>\n<span style=\"color: red;\"> \u7d50\u679c: <\/span><span style=\"color: red;\">7<\/span><\/p>\n<p><span style=\"color: #ff99ff; font-weight: bold;\">Day(<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u65e5\u671f\u6642\u9593<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u6216\u5b57\u4e32)<\/span><br \/>\n-\u50b3\u56de\u65e5\u671f<span style=\"font-weight: bold;\">\u65e5<\/span>\u7684\u90e8\u4efd<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write <\/span><span style=\"color: red;\">Day<\/span><span style=\"color: red;\">(&#8220;<\/span><span style=\"color: red;\">2009\/7\/4 \u4e0a\u5348 12:45:36<\/span><span style=\"color: red;\">&#8220;)<\/span><br \/>\n<span style=\"color: red;\"> \u7d50\u679c: <\/span><span style=\"color: red;\">4<\/span><\/p>\n<p><span style=\"color: #ff99ff; font-weight: bold;\">DayValue(<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u65e5\u671f\u6642\u9593<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u6216\u5b57\u4e32)<\/span><br \/>\n-\u50b3\u56de\u65e5\u671f<span style=\"font-weight: bold;\">\u5e74\u6708\u65e5<\/span>\u7684\u90e8\u4efd<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write <\/span><span style=\"color: red;\">DayValue<\/span><span style=\"color: red;\">(<\/span><span style=\"color: red;\">&#8220;2009\/7\/4 \u4e0a\u5348 12:45:36&#8221;<\/span><span style=\"color: red;\">)<\/span><br \/>\n<span style=\"color: red;\"> \u7d50\u679c: <\/span><span style=\"color: red;\">2009\/7\/4<\/span><\/p>\n<p><span style=\"color: #ff99ff; font-weight: bold;\">TimeValue(<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u65e5\u671f\u6642\u9593<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u6216\u5b57\u4e32)<\/span><br \/>\n-\u50b3\u56de\u65e5\u671f<span style=\"font-weight: bold;\">\u6642\u9593<\/span>\u7684\u90e8\u4efd<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write <\/span><span style=\"color: red;\">TimeValue<\/span><span style=\"color: red;\">(<\/span><span style=\"color: red;\">&#8220;2009\/7\/4 \u4e0a\u5348 12:45:36&#8221;<\/span><span style=\"color: red;\">)<\/span><br \/>\n<span style=\"color: red;\"> \u7d50\u679c: <\/span><span style=\"color: red;\">\u4e0a\u5348 12:45:36<\/span><\/p>\n<p><span style=\"color: #ff99ff; font-weight: bold;\">DatePart(\u6b32\u50b3\u56de\u4e4b\u90e8\u5206<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u65e5\u671f\u6642\u9593<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u6216\u5b57\u4e32)<\/span><br \/>\n-\u50b3\u56de\u67d0\u90e8\u4efd\u7684\u65e5\u671f\u6642\u9593<br \/>\n-yyyy Year \u5e74<br \/>\n-q Quarter  \u5b63<br \/>\n-m Month \u6708<br \/>\n-d Day \u65e5<br \/>\n-w Weekday \u661f\u671f<br \/>\n-h Hour \u6642<br \/>\n-n Minute \u5206<br \/>\n-s Second \u79d2<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write <\/span><span style=\"color: red;\">DatePart<\/span><span style=\"color: red;\">(<\/span><span style=\"color: red;\">&#8220;s&#8221;,&#8221;2009\/7\/4 \u4e0a\u5348 12:45:36&#8243;<\/span><span style=\"color: red;\">)<\/span><br \/>\n<span style=\"color: red;\"> \u7d50\u679c: <\/span><span style=\"color: red;\">36<\/span><\/p>\n<p><span style=\"color: #ff99ff; font-weight: bold;\"><a name=\"Weekday(\u65e5\u671f\u904b\u7b97\u5f0f,[FW])\">Weekday<\/a><\/span><span style=\"color: #ff99ff; font-weight: bold;\">(<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u65e5\u671f\u6642\u9593<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u6216\u5b57\u4e32)<\/span><br \/>\n-\u50b3\u56de\u661f\u671f\u7684\u6578\u5b57: 1=\u661f\u671f\u65e5,2=\u661f\u671f\u4e00,3=\u661f\u671f\u4e8c,4=\u661f\u671f\u4e09,5=\u661f\u671f\u56db,6=\u661f\u671f\u4e94,7=\u661f\u671f\u516d<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write <\/span><span style=\"color: red;\">TimeValue<\/span><span style=\"color: red;\">(<\/span><span style=\"color: red;\">&#8220;2009\/7\/4 \u4e0a\u5348 12:45:36&#8221;<\/span><span style=\"color: red;\">)<\/span><br \/>\n<span style=\"color: red;\"> \u7d50\u679c: <\/span><span style=\"color: red;\">7<\/span><\/p>\n<p><span style=\"color: #ff99ff; font-weight: bold;\"><a name=\"Weekday(\u65e5\u671f\u904b\u7b97\u5f0f,[FW])\">FormatDateTime<\/a><\/span><span style=\"color: #ff99ff; font-weight: bold;\">(<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u65e5\u671f\u6642\u9593<\/span><span style=\"color: #ff99ff; font-weight: bold;\">\u6216\u5b57\u4e32,\u683c\u5f0f)<\/span><br \/>\n-\u6839\u64da\u683c\u5f0f\u5b9a\u7fa9\u50b3\u56de\u65e5\u671f\u6642\u9593\uff0c\u683c\u5f0f\u5b9a\u7fa9\u6709\u4e0b\u5217\u5e7e\u7a2e:<br \/>\n-vbGeneralDate:\u986f\u793a\u65e5\u671f\u548c\/\u6216\u6642\u9593\u3002\u5982\u679c\u6709\u65e5\u671f\u90e8\u5206\uff0c\u5247\u5c07\u8a72\u90e8\u5206\u986f\u793a\u70ba\u77ed\u65e5\u671f\u683c\u5f0f\u3002\u5982\u679c\u6709\u6642\u9593\u90e8\u5206\uff0c\u5247\u5c07\u8a72\u90e8\u5206\u986f\u793a\u70ba\u9577\u6642\u9593\u683c\u5f0f\u3002\u5982\u679c\u90fd\u5b58\u5728\uff0c\u5247\u986f\u793a\u6240\u6709\u90e8\u5206\u3002<br \/>\n-vbLongDate: \u7cfb\u7d71\u8a2d\u7f6e\u4e2d\u6307\u5b9a\u7684\u9577\u65e5\u671f\u683c\u5f0f\u986f\u793a\u65e5\u671f<br \/>\n-vbShortDate: \u7cfb\u7d71\u8a2d\u7f6e\u4e2d\u6307\u5b9a\u7684\u77ed\u65e5\u671f\u683c\u5f0f\u986f\u793a\u65e5\u671f<br \/>\n-vbLongTime: \u7cfb\u7d71\u8a2d\u7f6e\u4e2d\u6307\u5b9a\u7684\u6642\u9593\u683c\u5f0f\u986f\u793a\u6642\u9593<br \/>\n-vbShortTime: \u4f7f\u7528 24 \u5c0f\u6642\u683c\u5f0f (hh:mm) \u986f\u793a\u6642\u9593<br \/>\n<span style=\"color: red;\">\u7a0b\u5f0f:  response.write <\/span><span style=\"color: red;\"><a name=\"Weekday(\u65e5\u671f\u904b\u7b97\u5f0f,[FW])\">FormatDateTime<\/a><\/span><span style=\"color: red;\">(<\/span><span style=\"color: red;\">&#8220;2009\/7\/4 \u4e0a\u5348 12:45:36&#8221;<\/span><span style=\"color: red;\">)<\/span><br \/>\n<span style=\"color: red;\"> \u7d50\u679c: <\/span><span style=\"color: red;\">12:45<\/span><\/p>\n<p>\u6709\u4e86\u9019\u4e9b\u61c9\u8a72\u5920\u7528\u4e86!<span style=\"color: red;\"> <\/span><\/p>\n<p><span style=\"color: red;\"><br \/>\n<\/span><\/p>\n<p>\u4e0a\u9762\u8b1b\u5230\u7684\u984c\u76ee(<span style=\"color: #666699;\">\u5047\u8a2d\u73fe\u5728\u7684\u6642\u9593 Now()\u662f &#8220;2009\/7\/4 \u4e0a\u5348 12:45:36&#8243;\uff0c\u82e5\u8981\u8f49\u6210&#8221;2009\/07\/04 00:45:36&#8243;\uff0c\u8a72\u600e\u9ebc\u505a\u5462?<\/span>)\uff0c\u7b54\u6848\u5c31\u662f\u4e0b\u9762\u9019\u4e32:<br \/>\n<span style=\"color: red;\">now_time = Year(Now()) &amp; &#8220;\/&#8221; &amp; Right(&#8220;0&#8243;&amp;Month(Now()),2) &amp; &#8220;\/&#8221; &amp; Right(&#8220;0&#8243; &amp; Day(Now()),2) &amp; &#8221; &#8221; &amp; FormatDateTime(Now(),vbShortTime) &amp; &#8220;:&#8221; &amp; Right(&#8220;0&#8221; &amp; DatePart(&#8220;s&#8221;,Now()),2)<\/span><\/p>\n<p><span style=\"color: red;\"><br \/>\n<\/span><span style=\"font-weight: bold;\">\u8a2d\u8a08\u5fc3\u5f97:<\/span><span style=\"color: red;\"><br \/>\n<\/span>\u77ad\u89e3\u5404\u500b\u8a9e\u6cd5\u7684\u7528\u9014\uff0c\u628a\u5b83\u7576\u4f5c\u904a\u6232\u4f86\u7d44\u5408\uff0c\u5176\u5be6\u9084\u883b\u597d\u73a9\u7684!<\/p>\n<p>&nbsp;<\/p>\n<h3>2011\/6\/29 \u66f4\u65b0:<\/h3>\n<p>\u5982\u679c\u8981\u66f4\u5feb\u901f\u505a\u65e5\u671f\u7684\u8f49\u63db\uff0c\u8acb\u53c3\u8003\u4e0b\u9762\u9019\u7bc7:<\/p>\n<h2><a title=\"Permalink to \u4e00\u500bFunction\u641e\u5b9a ASP \u65e5\u671f\u6642\u9593\u683c\u5f0f\u8f49\u63db\" rel=\"bookmark\" href=\"http:\/\/iwisdomsys.com\/?p=128\">\u4e00\u500bFUNCTION\u641e\u5b9a ASP \u65e5\u671f\u6642\u9593\u683c\u5f0f\u8f49\u63db<\/a><\/h2>\n<p>&nbsp;<\/p>\n<p><span style=\"color: red;\"><br \/>\n<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5bebasp\u7a0b\u5f0f\u6642\uff0c\u65e5\u671f\u9577\u662f\u500b\u9ebb\u7169\uff0c\u5c24\u5176\u662f\u6488\u8cc7\u6599\u5eab\u7684\u65e5\u671f\u51fa\u4f86\u6bd4\u5c0d\uff0c\u6216\u662f\u8981\u4ee5\u67d0\u7a2e\u65e5\u671f\u683c\u5f0f\u5beb\u5165\u8cc7\u6599\u5eab\u6642\uff0c\u65e5\u671f\u683c\u5f0f\u5e38\u8981 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/iwisdomsys.com\/?p=78\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008asp \u65e5\u671f\u8a9e\u6cd5\u6574\u7406\u3009<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":81,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11,10],"tags":[21,22,23],"_links":{"self":[{"href":"http:\/\/iwisdomsys.com\/index.php?rest_route=\/wp\/v2\/posts\/78"}],"collection":[{"href":"http:\/\/iwisdomsys.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/iwisdomsys.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/iwisdomsys.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/iwisdomsys.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=78"}],"version-history":[{"count":4,"href":"http:\/\/iwisdomsys.com\/index.php?rest_route=\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":80,"href":"http:\/\/iwisdomsys.com\/index.php?rest_route=\/wp\/v2\/posts\/78\/revisions\/80"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/iwisdomsys.com\/index.php?rest_route=\/wp\/v2\/media\/81"}],"wp:attachment":[{"href":"http:\/\/iwisdomsys.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/iwisdomsys.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/iwisdomsys.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}