Changeset 93
- Timestamp:
- Feb 12, 2007, 12:04:01 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/DateTime.ab
r82 r93 85 85 End Sub 86 86 87 Function Operator == (ByRef value As DateTime) As B OOL87 Function Operator == (ByRef value As DateTime) As Boolean 88 88 Return Equals(value) 89 89 End Function 90 90 91 Function Operator <> (ByRef value As DateTime) As B OOL91 Function Operator <> (ByRef value As DateTime) As Boolean 92 92 Return Not Equals(value) 93 93 End Function 94 94 95 Function Operator > (ByRef value As DateTime) As B OOL95 Function Operator > (ByRef value As DateTime) As Boolean 96 96 If DateTime.Compare(This, value) > 0 Then 97 Return _System_TRUE98 Else 99 Return _System_FALSE100 End If 101 End Function 102 103 Function Operator < (ByRef value As DateTime) As B OOL97 Return True 98 Else 99 Return False 100 End If 101 End Function 102 103 Function Operator < (ByRef value As DateTime) As Boolean 104 104 If DateTime.Compare(This, value) < 0 Then 105 Return _System_TRUE106 Else 107 Return _System_FALSE108 End If 109 End Function 110 111 Function Operator >= (ByRef value As DateTime) As B OOL105 Return True 106 Else 107 Return False 108 End If 109 End Function 110 111 Function Operator >= (ByRef value As DateTime) As Boolean 112 112 If DateTime.Compare(This, value) => 0 Then 113 Return _System_TRUE114 Else 115 Return _System_FALSE116 End If 117 End Function 118 119 Function Operator <= (ByRef value As DateTime) As B OOL113 Return True 114 Else 115 Return False 116 End If 117 End Function 118 119 Function Operator <= (ByRef value As DateTime) As Boolean 120 120 If DateTime.Compare(This, value) <= 0 Then 121 Return _System_TRUE122 Else 123 Return _System_FALSE121 Return True 122 Else 123 Return False 124 124 End If 125 125 End Function … … 222 222 End Function 223 223 224 Function Equals(ByRef value As DateTime) As B OOL224 Function Equals(ByRef value As DateTime) As Boolean 225 225 If value.m_Date = m_Date Then 226 Return _System_TRUE227 Else 228 Return _System_FALSE229 End If 230 End Function 231 232 Static Function Equals(ByRef t1 As DateTime, ByRef t2 As DateTime) As B OOL226 Return True 227 Else 228 Return False 229 End If 230 End Function 231 232 Static Function Equals(ByRef t1 As DateTime, ByRef t2 As DateTime) As Boolean 233 233 If t1.m_Date = t2.m_Date Then 234 Return _System_TRUE235 Else 236 Return _System_FALSE234 Return True 235 Else 236 Return False 237 237 End If 238 238 End Function … … 287 287 End Sub 288 288 289 Function DaysInMonth(year As Long, month As Long) As Long289 Static Function DaysInMonth(year As Long, month As Long) As Long 290 290 If year < 1 Or year > 9999 Or month < 1 Or month > 12 Then 291 291 'ArgumentOutOfRangeException 292 292 debug 293 293 End If 294 Select Case month 295 Case 1 296 Return 31 297 Case 2 298 If IsLeapYear(year) = TRUE Then 299 Return 29 300 Else 301 Return 28 302 End If 303 Case 3 304 Return 31 305 Case 4 306 Return 30 307 Case 5 308 Return 31 309 Case 6 310 Return 30 311 Case 7 312 Return 31 313 Case 8 314 Return 31 315 Case 9 316 Return 30 317 Case 10 318 Return 31 319 Case 11 320 Return 30 321 Case 12 322 Return 31 323 End Select 324 End Function 325 326 Function IsLeapYear(year As Long) As BOOL 327 If (year Mod 4) = 0 Then 328 If (year Mod 100) = 0 Then 329 If (year Mod 400) = 0 Then 330 Return _System_TRUE 331 End If 332 Return _System_FALSE 333 Else 334 Return _System_TRUE 335 End If 336 End If 337 Return _System_FALSE 294 If IsLeapYear(year) And month = 2 Then 295 Return 29 296 Else 297 Dim daysInMonth[11] = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] As Byte 298 Return daysInMonth[month - 1] 299 End If 300 End Function 301 302 Static Function IsLeapYear(year As Long) As Boolean 303 If (year Mod 400) = 0 Then Return True 304 If (year Mod 100) = 0 Then Return False 305 If (year Mod 4) = 0 Then Return True 338 306 End Function 339 307
Note:
See TracChangeset
for help on using the changeset viewer.