Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
richard_chilvers
Specialist
Specialist

Day Number

Hi

According to my documentation, in a script, the function WeekDay produces a number between 0-6. When I use it, I get a day name (eg. Mon). I suspect this may be to do with my settings.

Any ideas?

Thanks

1 Solution

Accepted Solutions
Not applicable

Hi,

Try this..

=num(WeekDay(today()))

View solution in original post

4 Replies
Not applicable

Hi,

Try this..

=num(WeekDay(today()))

richard_chilvers
Specialist
Specialist
Author

Great thanks !

That does the trick; is the documentation wrong, or am I just misunderstanding ?

swuehl
MVP
MVP

Richard,

the documentation is wrong (at least weak / misleading), because weekday() is in fact returning a dual value with a text representation given the weekday name (as defined in the script or OS), and the weekday number (0 to 6).

This is similar to today() which returns a date as well in your standard date format (like 2013/02/13) and in a numerical representation: 41318.

Hope this helps,

Stefan

richard_chilvers
Specialist
Specialist
Author

Stefan

That's a really helpful explanation and gives a good understanding to what's going on here.

Regards