For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Syntax > February 2006 > Converting a date into a day of week









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Converting a date into a day of week
RSH

2006-02-13, 7:04 pm

Hi,

Does anyone have a function that returns the day of w (Sun-Sat) from a
user supplied date (4/12/2006).

Thanks!
Ron


Rick Rothstein [MVP - Visual Basic]

2006-02-13, 7:04 pm

> Does anyone have a function that returns the day of w
> (Sun-Sat) from a user supplied date (4/12/2006).


You can either combine two functions to get this...

Print WdayName(Wday("4/12/2006"), True)

Note: The optional True argument makes the WdayName function return an
abbreviated day name (False spells the name out in full).

Or, you can use the old workhorse Format function to do it...

Print Format$("4/12/2006", "ddd")

and if you want the name spelled out in full, use "dddd" for the 2nd
argument instead.

Rick


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com