ASP implementation restrictions start a new activity every 5 minutes. Share the Judgment function

Source: Internet
Author: User
Tags current time
Start a new activity every 5 minutes each day to get the current time countdown to the next activity

The original function code is as follows, used as service-side tuning trial.

<%
Times = Now ()
For i = 0 to 23
If I <= 9 Then i = "0" &i
For II = 0 to 55
If II Mod 5 = 0 Then
If II <= 9 Then II = "0" &ii
arrstring = arrstring& "" &year & "/" &month (Times) & "/" &day (Times) & "&i&": "&ii&": 00 "
End If
Next
Next
Arrstring=arrstring&dateadd ("D", 1, "" &formatdatetime (times,2) & "")
' Response. Write arrstring& "

"

MyArray = Split (arrstring, "")
For o = 0 to UBound (myarray)
Gametime = MyArray (o)
id = o + 1
If Datediff ("s", Times,gametime) > 1 Then Exit for
Next
' Response. Write gametime& "=======" &id
%>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.