 |
 |

12-22-2003, 12:06 PM
|
 |
Tachikoma
|
|
Join Date: Mar 2003
Location: Mansfield, UK
Posts: 4,594
|
|
birthday
|
hi, how can i tell if its someones birthday?
i have the date of birth 00/00/0000, and i have todays date, i want to know if they match. i could use the left() function to see if the day and month match but.... i have a time shift thing on it for timezones. i have a sub that will need to take the time and add or take the correct amount of hours, then if it goes to another day, it needs to adjust the date.
any ideas how i can do the timeshift AND the birthday subs?
i know i can use the datediff() function but im not quite sure how to go about it, i need the timeshift result to be in the same format as the now function
|
|

12-22-2003, 12:09 PM
|
 |
Junior Contributor
|
|
Join Date: Jul 2003
Location: Brazil
Posts: 213
|
|
ok, just make something like this:
Code:
If Cdate(now) = cdate("01/01/2003) then
'yes its today
End If
|
__________________
tHuNd3rSp0t
Believe
Dreaming is the first step for any conquest
|

12-22-2003, 12:19 PM
|
 |
Martian In Disguise
Retired Moderator * Guru *
|
|
Join Date: May 2003
Location: Minneapolis, MN
Posts: 9,566
|
|
You could use the DatePart function to compare the Day and Month of both the BirthDate and the current Date or you could use the Day and Month functions to a similar comparison.
Code:
' Assumes dteBirth is a variable containing the date of birth.
If Month(dteBirth) = Month(Date) And Day(dteBirth) = Day(Date) Then
MsgBox "Today is your birthday!"
End If
|
__________________
The only stupid question is the one that goes un-asked.
|

12-22-2003, 12:28 PM
|
 |
Tachikoma
|
|
Join Date: Mar 2003
Location: Mansfield, UK
Posts: 4,594
|
|
|
ok, that looks like its gonna work fine now, thanx.
now what about the dateshift part? the timezone will be stored as hour and minute difference. 00:00. how do i make a function that can take care of that
private function DateShift(nDate as date) as date
i need it to convert the whole date and time, not just the time, if its 11:00 pm and someone is in a +3:00 timezone then it will show as 14:00 am. how do i sort that out?
|
|

12-22-2003, 12:31 PM
|
 |
Martian In Disguise
Retired Moderator * Guru *
|
|
Join Date: May 2003
Location: Minneapolis, MN
Posts: 9,566
|
|
|
You can use the DateAdd function to add/subtract hours from a given date.
|
__________________
The only stupid question is the one that goes un-asked.
|

12-22-2003, 12:39 PM
|
 |
Tachikoma
|
|
Join Date: Mar 2003
Location: Mansfield, UK
Posts: 4,594
|
|
|
hmm, simple. lol.
vb seems to have a function for everything
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
Happy Birthday Lebb
|
Robby |
Tech Discussions |
38 |
07-26-2002 12:06 AM |
|
Happy Birthday Bob
|
Derek Stone |
Tech Discussions |
16 |
04-01-2002 11:28 PM |
|
|
|
|
|
 |
|