How do I format Sunday, October 22, 2000 07:26:00-EDT so that I can get the day number by itself and the month by itself. Then I want to get 07:26:00 into a string!
Printable View
How do I format Sunday, October 22, 2000 07:26:00-EDT so that I can get the day number by itself and the month by itself. Then I want to get 07:26:00 into a string!
I think i new that already, but i didn't use it for a reason! CUZ IT DOESN'T WORK!
THIS IS WHAT I GET: Sunday, October 22, 2000 08:41:06-EDT
AND I WANT TO GET EACH WORD BY ITSELF. FOR EXAMPLE:
SUNDAY <--BY ITSELF
OCTOBER <--BY ITSELF
hi VIP3R !!!
Look at the help under "format"
'day Name
debug.print format(date(),"dddd")
'month Name
debug.print format(date(),"mmmm")
and so on
-cu TheOnly
Here are some other cool VB intrinsic functions you can play with:
These functions work with any Date data type. Don't know if they're useful to you for what you're doing, but they are good to know. You can do more with the Format function that TheOnly suggested.Code:MsgBox Now ' Displays: "10/29/2000 10:57:30 AM"
MsgBox Month(Now) ' Displays: "10"
MsgBox MonthName(Month(Now)) ' Displays: "October"
MsgBox Day(Now) ' Displays: "29"
MsgBox WeekdayName(Weekday(Now)) ' Displays: "Sunday"
MsgBox Year(Now) ' Displays: "2000"
MsgBox Hour(Now) ' Displays: "10"
MsgBox Minute(Now) ' Displays: "57"
MsgBox Second(Now) ' Displays: "30"