What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Making a plugin help

Making a plugin help
Author: Message:
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
RE: Making a plugin help
its only math mate :)

work out age, how many months + days till birthday :)

code:
Function YMD(StartDate As Date, EndDate As Date) As String
Dim TempDate As Date
Dim NumOfYears As Long
Dim NumOfMonths As Long
Dim NumOfWeeks As Long
Dim NumOfDays As Long
Dim NumOfHMS As Double
Dim TSerial1 As Double
Dim TSerial2 As Double
NumOfYears = DateDiff("yyyy", StartDate, EndDate)
TSerial1 = TimeSerial(Hour(StartDate), _
Minute(StartDate), Second(StartDate))
TSerial2 = TimeSerial(Hour(EndDate), _
Minute(EndDate), Second(EndDate))
NumOfHMS = 24 * (TSerial2 - TSerial1)
If NumOfHMS < 0 Then
NumOfHMS = NumOfHMS + 24
EndDate = DateAdd("yyyy", -1, EndDate)
End If
StartDate = DateSerial(Year(EndDate), _
Month(StartDate), Day(StartDate))
If StartDate > EndDate Then
StartDate = DateAdd("d", -1, StartDate)
NumOfYears = NumOfYears - 1
End If
NumOfMonths = DateDiff("m", StartDate, EndDate)
StartDate = DateSerial(Year(EndDate), _
Month(EndDate), Day(StartDate))
If StartDate > EndDate Then
StartDate = DateAdd("m", -1, StartDate)
NumOfMonths = NumOfMonths - 1
End If
NumOfDays = Abs(DateDiff("d", StartDate, EndDate))
YMD = CStr(NumOfYears) & " year" & _
IIf(NumOfYears = 1, "", "s")
YMD = YMD & ", "
YMD = YMD & CStr(NumOfMonths) & " month" & _
IIf(NumOfMonths = 1, "", "s")
YMD = YMD & ", "
YMD = YMD & CStr(NumOfDays) & " day" & _
IIf(NumOfDays = 1, "", "s")
End Function


04-25-2005 06:15 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Making a plugin help - by OWNd742 on 04-25-2005 at 05:39 PM
RE: Making a plugin help - by Stigmata on 04-25-2005 at 05:40 PM
RE: Making a plugin help - by OWNd742 on 04-25-2005 at 05:43 PM
RE: Making a plugin help - by CookieRevised on 04-25-2005 at 05:51 PM
RE: Making a plugin help - by Tasha on 04-25-2005 at 05:59 PM
RE: Making a plugin help - by OWNd742 on 04-25-2005 at 06:00 PM
RE: Making a plugin help - by Stigmata on 04-25-2005 at 06:15 PM
RE: Making a plugin help - by OWNd742 on 04-25-2005 at 06:23 PM
RE: Making a plugin help - by (CyBeRDuDe) on 04-26-2005 at 07:22 AM
RE: Making a plugin help - by RaceProUK on 04-26-2005 at 08:25 AM
RE: Making a plugin help - by OWNd742 on 05-02-2005 at 10:23 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On