Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. Dim alarmDate As Date = #3/11/2010#
  2. Dim currentDate As Date = Date.Now
  3. If alarmDate.Day = currentDate.Day AndAlso alarmDate.Month = currentDate.Month Then
  4. 'Do Something here
  5. End If
  6.  
  7. Imports System.Runtime.CompilerServices
  8.  
  9. Module ExtensionMethods
  10. <Extension>
  11. Public Function IsSameMonthAndDayAs(d1 As Date, d2 As Date) As Boolean
  12. Return d1.Day = d2.Day AndAlso d1.Month = d2.Month
  13. End Function
  14. End Module
  15.  
  16. Dim d As Date = #1/11/2010#
  17. If Date.Now.IsSameMonthAndDayAs(d) Then
  18. 'Do something here
  19. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement