|
-
Nov 12th, 2000, 11:47 AM
#1
Thread Starter
transcendental analytic
Whats the code behind the weekday function? i need a simple fast algoritm that calculates what day it is
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 12th, 2000, 12:00 PM
#2
Hyperactive Member
Have a look
WeekdayName(weekday, abbreviate, firstdayofweek)
The WeekdayName function syntax has these parts:
Part Description
weekday Required. The numeric designation for the day of
the week. Numeric value of each day depends on setting of the firstdayofweek setting.
abbreviate Optional. Boolean value that indicates if the weekday name is to be abbreviated. If omitted, the default is False, which means that the weekday name is not
abbreviated.
firstdayofweek Optional. Numeric value indicating the first
day of the week. See Settings section for values.
Settings
The firstdayofweek argument can have the following values:
Constant Value Description
vbUseSystem 0 Use National Language Support (NLS) API setting.
vbSunday 1 Sunday (default)
vbMonday 2 Monday
vbTuesday 3 Tuesday
vbWednesday 4 Wednesday
vbThursday 5 Thursday
vbFriday 6 Friday
vbSaturday 7 Saturday
[]P
Visual Basic 6 SP4 on win98se
QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!
-
Nov 12th, 2000, 12:04 PM
#3
Thread Starter
transcendental analytic
Eh, nope that's not what i need. I need to get the weekday from a date, without using a vb function, and it could return an index as well...
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 12th, 2000, 12:44 PM
#4
OK, here's my chance to help a guru! Try this, kedaman:
Code:
Function DayOfWeek(lngYear As Long, lngMonth As Long, lngDay As Long) As Long
' sample call: lngMyDOW = DayOfWeek(2000, 11, 12)
' the value returned will be from 0 to 6, which is Sunday to Saturday
If lngMonth < 3 Then
lngYear = lngYear - 1
lngMonth = lngMonth + 12
End If
DayOfWeek = (lngDay + (153 * lngMonth - 457) \ 5 + 365 * lngYear + lngYear \ 4 - lngYear \ 100 + lngYear \ 400 + 2) Mod 7
End Function
The source for this came from the following link:
http://www.capecod.net/~pbaum/date/date0.htm
"It's cold gin time again ..."
Check out my website here.
-
Nov 12th, 2000, 01:14 PM
#5
Thread Starter
transcendental analytic
Thanks! that exactly what i needed
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 12th, 2000, 04:43 PM
#6
_______
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Apr 29th, 2003, 10:09 PM
#7
Lively Member
Hey VB Gurus Please help me !
I want to send Month and Year as parameters to Crystal Report. And want to display all dates and days in that month. For this purpose I have created labels from 1 to 31. But how to send parameters to Crystal Report and how to figure out Days for each date ???
Everybody is always learning something new ! 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|