-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.asp
More file actions
60 lines (43 loc) · 1.3 KB
/
utils.asp
File metadata and controls
60 lines (43 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<%
function RandomString()
Randomize()
dim CharacterSetArray
CharacterSetArray = Array(_
Array(10, "abcdefghijklmnopqrstuvwxyz"), _
Array(3, "0123456789") _
)
dim i
dim j
dim Count
dim Chars
dim Index
dim Temp
for i = 0 to UBound(CharacterSetArray)
Count = CharacterSetArray(i)(0)
Chars = CharacterSetArray(i)(1)
for j = 1 to Count
Index = Int(Rnd() * Len(Chars)) + 1
Temp = Temp & Mid(Chars, Index, 1)
next
next
dim TempCopy
do until Len(Temp) = 0
Index = Int(Rnd() * Len(Temp)) + 1
TempCopy = TempCopy & Mid(Temp, Index, 1)
Temp = Mid(Temp, 1, Index - 1) & Mid(Temp, Index + 1)
loop
RandomString = TempCopy
end function
Public Function ToIsoDateTime(datetime)
ToIsoDateTime = ToIsoDate(datetime) & "T" & ToIsoTime(datetime) & "+09:00"
End Function
Public Function ToIsoDate(datetime)
ToIsoDate = CStr(Year(datetime)) & "-" & StrN2(Month(datetime)) & "-" & StrN2(Day(datetime))
End Function
Public Function ToIsoTime(datetime)
ToIsoTime = StrN2(Hour(datetime)) & ":" & StrN2(Minute(datetime)) & ":" & StrN2(Second(datetime))
End Function
Private Function StrN2(n)
If Len(CStr(n)) < 2 Then StrN2 = "0" & n Else StrN2 = n
End Function
%>