Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 12th, 2003, 11:43 AM
Authorized User
 
Join Date: Oct 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Simple Date question

<edit>Edited to remove the offensive line which was originally meant to be a little bit humourous. I realize that it may be lost in posting. I did do a search using "vb.net" "month name" and variations on that with no luck. I did not mean to imply that anyone else's time was worth being wasted. I just hit a brick wall mentally and was hoping that someone on this board had the solution.</end edit>

I want to get the string name for the current month or of any date variable actually.
Code:
Now().Month.ToString
Just returns the integer value. I could write a simple case subroutine to look at the integer and return the name but I'm hoping that there is a method or property already out there.

Thanks,
Risu
 
Old November 12th, 2003, 11:50 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Right, so because you're too lazy to find out stuff yourself, you expect us to waste our time instead and do your work. Yeah, that makes sense, and I am sure it will get you really far.... ;)

Cheers,

Imar

P.S. Google will give you the answer in 1.5 seconds, less time than it takes the time to post your question here.


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old November 12th, 2003, 12:00 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oh, I know how to do that . . . . . . . . . . . . . . . . . . . . . . . . .



Sal
 
Old November 12th, 2003, 12:12 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Well, don't bother telling us; We may be too lazy to read this post after all.... ;)

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old November 12th, 2003, 12:15 PM
Authorized User
 
Join Date: Oct 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Fair enough....
ever have one of those moments you just wish you could take back...

Thanks,
Risu
 
Old November 12th, 2003, 12:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Being the moderator of the forum I can delete the thread if you wish-- that's as close to taking it back I can do for you :)

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old November 12th, 2003, 12:27 PM
Authorized User
 
Join Date: Oct 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I hope that this will somewhat makeup for my transgressions.

Code:
Now().ToString("MMM")
I was looking in the wrong place. I kept working off the Month property. I never even realized that some ToString functions have a format parameter. Thank you MSDN

Thanks,
Risu
 
Old November 12th, 2003, 12:43 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

LOL ;)

I believe this is indeed the right way to do it as it will yield CLR compliant code. There is also an alternative in the VisualBasic namespace:

Microsoft.VisualBasic.DateAndTime.MonthName(11)


Cheers,

Imar

---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
very simple question rogdawg Visual Studio 2005 2 January 14th, 2008 04:03 PM
Very Simple Question YoungLuke C# 2 May 4th, 2007 02:23 AM
Simple Question ironchef Spring 2 April 30th, 2007 09:32 AM
Simple Question ironchef Java GUI 0 September 14th, 2006 04:56 PM
A simple question about date in VBA for Excel 2002 Trancefuzion Excel VBA 2 July 29th, 2004 04:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.