473,657 Members | 2,594 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get name of month

When I use
Dim myDTFI As DateTimeFormatI nfo = New CultureInfo("he-IL",
True).DateTimeF ormat
Dim strhmon1 As String = (myDTFI.GetMont hName(hmon1))
MsgBox(strhmon1 )

I get the local name of the gregorian month.
How do I get the local name of the local month ?

Tia
Nov 21 '05 #1
34 9286
Prosoft.
Now.ToString("M MMM")

I hope this helps?

Cor


"prosoft" <ifyouneedmyema ilpleaseask> schreef in bericht
news:ev******** ******@TK2MSFTN GP09.phx.gbl...
When I use
Dim myDTFI As DateTimeFormatI nfo = New CultureInfo("he-IL",
True).DateTimeF ormat
Dim strhmon1 As String = (myDTFI.GetMont hName(hmon1))
MsgBox(strhmon1 )

I get the local name of the gregorian month.
How do I get the local name of the local month ?

Tia

Nov 21 '05 #2
Your code worked fine for me.
'Condensed version
Dim c As New CultureInfo("he-IL")
MessageBox.Show (c.DateTimeForm at.GetMonthName (Now.Month))

"prosoft" <ifyouneedmyema ilpleaseask> wrote in message
news:ev******** ******@TK2MSFTN GP09.phx.gbl...
When I use
Dim myDTFI As DateTimeFormatI nfo = New CultureInfo("he-IL",
True).DateTimeF ormat
Dim strhmon1 As String = (myDTFI.GetMont hName(hmon1))
MsgBox(strhmon1 )

I get the local name of the gregorian month.
How do I get the local name of the local month ?

Tia

Nov 21 '05 #3
I am getting the wrong information, is it a bug?

Dim tstHCal As New HebrewCalendar
Dim tstDT As New DateTime(2004, 9, 1) ' 1 sep' 2004
Dim hmonth As Integer = myHCal.GetMonth (tstDT)
Dim tstDTFI As DateTimeFormatI nfo = New CultureInfo("he-IL",
True).DateTimeF ormat
tstDTFI.Calenda r = myHCal
Dim hmonthName As String = (tstDTFI.GetMon thName(hmonth))
MsgBox(hmonthNa me)

the output is "Av"
it should be "Elul" because 1 sep' 2004 is in "elul" , see hebcal.com
I can see what is happening as well. Usually month 12 (as in Gregorian
2004,9,1)
is "elul" , but when there is a leap year month 12 is "av" and month 13 is
"elul".
The problem is that
Dim hmonthName As String = (tstDTFI.GetMon thName(hmonth))
has no way of knowing if it's a leap year or not, so it always returns
a value as if it was a leap year. Is it supposed to be this way?

Nov 21 '05 #4
* "Jared" <VB***********@ email.com> scripsit:
Your code worked fine for me.
'Condensed version
Dim c As New CultureInfo("he-IL")
MessageBox.Show (c.DateTimeForm at.GetMonthName (Now.Month))


I get something I am not able to read and translate to Roman letters
:-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #5
You're right, I too get something; I don't know if it's correct, the method
didn't fail, good enough for me.

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:O1******** ******@TK2MSFTN GP11.phx.gbl...
* "Jared" <VB***********@ email.com> scripsit:
Your code worked fine for me.
'Condensed version
Dim c As New CultureInfo("he-IL")
MessageBox.Show (c.DateTimeForm at.GetMonthName (Now.Month))


I get something I am not able to read and translate to Roman letters
:-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #6
I am not sure if you saw my post just below your reply, the timestamp
on it is 15:35. I explained that

Dim hmonthName As String = (tstDTFI.GetMon thName(hmonth))

cannot return the correct name because within this expression
there is no TimeDate information. I was just wondering why
GetMonthName was not included in the DateTime object,
perhaps I am doing something wrong... It's not a bug, maybee
a design bug, but not an implementation bug.

B.t.w. if you want to see hebrew text you need to add the
hebrew keyboard in the control panel, it's as easy as 1,2,3.
"Jared" <@vb*********** @hotmail.com> wrote in message
news:10******** *****@corp.supe rnews.com...
You're right, I too get something; I don't know if it's correct, the method didn't fail, good enough for me.

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:O1******** ******@TK2MSFTN GP11.phx.gbl...
* "Jared" <VB***********@ email.com> scripsit:
Your code worked fine for me.
'Condensed version
Dim c As New CultureInfo("he-IL")
MessageBox.Show (c.DateTimeForm at.GetMonthName (Now.Month))


I get something I am not able to read and translate to Roman letters
:-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


Nov 21 '05 #7
* "Jared" <@vb*********** @hotmail.com> scripsit:
You're right, I too get something; I don't know if it's correct, the method
didn't fail, good enough for me.


OK, the same for me.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #8
Prosoft,

I gave you an answer earlier than any other? What is wrong with that, when I
do it like this I get it even in what I think is Herbrew (??????)

Me.Textbox1.tex t = Now.ToString("M MMM", New
System.Globaliz ation.CultureIn fo("he-IL"))
Cor
I am not sure if you saw my post just below your reply, the timestamp
on it is 15:35. I explained that

Dim hmonthName As String = (tstDTFI.GetMon thName(hmonth))

cannot return the correct name because within this expression
there is no TimeDate information. I was just wondering why
GetMonthName was not included in the DateTime object,
perhaps I am doing something wrong... It's not a bug, maybee
a design bug, but not an implementation bug.

B.t.w. if you want to see hebrew text you need to add the
hebrew keyboard in the control panel, it's as easy as 1,2,3.

Nov 21 '05 #9
ספטמבר
Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
44353
by: wolftor | last post by:
Month(date) shows the month number. Is there a way to get the month name ie. October? -- Regards, Peter
3
47979
by: wolftor | last post by:
Month(date) shows the month number. Is there a way to get the month name ie. October? -- Regards, Peter
10
6557
by: Colleyville Alan | last post by:
I am trying to turn a short and fat (63 columns) table into one that is tall and skinny (7 columns). Basically, I am trying to create a "reverse crosstab" using a looping structure in VBA along with SQL. I'd like to take the name of the column and input it into a descritor field. This isn't the table, but will serve as a better illustration than the real deal. If the table looks like this:
2
6793
by: troddy | last post by:
I am using the DatePart funtion in a query to extract the day, month and year in separate fields in a query. The function works fine but I am only getting a number for the month even if the field type is a long date and the month is stored in the table. I tried the following to try and get the name of the month to work. DateTest: Format(DatePart("m",),"mmmm") The DateAffirmed field had a date stored of 16/03/2006.
6
7229
by: Edwin Knoppert | last post by:
I can't find a way to obtain the months name from a date. Like 'August'
12
2229
by: Orchid | last post by:
Hello all, I have different version of reports which used for different months. For example, I am using report version 1 up to September, but we have some design changes on the report for October, so I created report version 2. I want a same Command Button to open the appropriated version report for the specific month. I create a table with the following Fields: Month, ReportID, ReportToOpen (this is the exact report name). On a form,...
2
15016
by: sachin shah | last post by:
Hi all i want result as month name from my query i tried with the following query but it give result as month number like (8) select (month(getdate())) as expr i want result as month name (Augest)..
16
1503
by: xz | last post by:
For example, I have a Class Date with internal variable year, month and day. In Java I would write: class Date{ int year; int month; int day; Date(int year, int month, int day) { this.year = year;
12
23192
by: Be Borth | last post by:
I saw previous solutions to convert a month number (1) to a month name (January). I have a database with 200+ dates. In a query, I use the "Part" function DatePart("m",), to extract the month (number) and all month extracts worked correctly (they returned the correct numerical month). However, when I attempted adding a field in the query to format that extracted month to a month name, it only returned January and December - for all 200+...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.