How to get JUST month name from a date?

V

VB Programmer

I have a date (such as 10/1/2004). How do I convert it to just "October"?
Thanks.
 
S

Shiva

DateTime.ToString ("MMMM")

I have a date (such as 10/1/2004). How do I convert it to just "October"?
Thanks.
 
M

mortb

Something like:

Dim MyString As String = "10/1/2004"
Dim MyDateTime As DateTime = DateTime.Parse(MyString, new
CultureInfo("en-US"))
Dim Month As String = MyDateTime.ToString("MMMM", new CultureInfo("en-US"))
 
Joined
Oct 14, 2009
Messages
1
Reaction score
0
How to get JUST month name from a date ???

Dim SalaryDate as DateTime
Dim MonthName as String

SalaryDate='03/11/2009'

MonthName = SalaryDate.ToString("MMMM")

It will Return 'November'

Thnx

By Shashi....
 
Joined
Jun 29, 2011
Messages
1
Reaction score
0
VBA - Convert numbers to month names

(Sorry comments only in portuguese, but the code is very simple)

Solution here.

Tags: André Luiz Bernardes, MS, Microsoft, Office, VBA, Access, Excel, Word, Outlook, Sharepoint, convert, YTD, QTD, MAT, MTD, Month, Mês, converter

André Luiz Bernardes
(e-mail address removed)
http://inanyplace.blogspot.com/
Santos - SP - Brazil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top