473,396 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

month name predefined function?

Hello, I'm using PHP 4. Is there a predefined function for returning
the name of the month given the input of the month represented as a
number between 1 and 12?

Thanks, - Dave

Jul 17 '05 #1
2 2380
On 30 Apr 2005 08:43:06 -0700, la***********@zipmail.com wrote:
the name of the month given the input of the month represented as a
number between 1 and 12?


Not easily, and only in English. You could use

echo date( 'F', mktime( 12, 0, 0, $month, 1, 2000, 0 ) );

(Use midday to avoid problems with daylight saving time).
Easier and less error prone would be

$monthname = array( 1 => 'January', 'February', 'March', <etc> );
echo $monthname[$month];
--
Firefox Web Browser - Rediscover the web - http://getffox.com/
Thunderbird E-mail and Newsgroups - http://gettbird.com/
Jul 17 '05 #2
I would just do it as this:

<?PHP
$intMonth = 3; // March
printf("%s",date("M", mktime(0, 0, 0, $intMonth, 1, 2000));
?>

Jul 17 '05 #3

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

Similar topics

3
by: wolftor | last post by:
Month(date) shows the month number. Is there a way to get the month name ie. October? -- Regards, Peter
1
by: Finlay | last post by:
Hi Group I am designing a report that should show a meter reading for each month and the previous meter reading for the previous month. The months are text stored in a field tMonth. The...
8
by: felecha | last post by:
Is there a control that I can put on a Form that would let a user select just the month value? I tried to find a way to make the DateTimePicker or the Month Calendar do what I want but I can't. ...
7
by: Novice Computer User | last post by:
Hi. Can somebody PLEASE help. I have spent hours on this.. but I am a total novice and can't seem to figure it out. Here is a .php script. Right now, the minimum amount of time (i.e. duration)...
18
by: PC Datasheet | last post by:
An Access user saw my name in a newsgroup and sent me a request for help on a project. As part of the project, a list of the dates in a month was needed. For anyone needing a list of dates in a...
12
by: shyam | last post by:
Hi all is there any way the determine which function currently is executing in a process ? For example we can find the file name using __FILE__ and line number using __LINE__ macros ...
10
by: Jim | last post by:
I'm sure this has been asked before but I can't find any postings. I have a table that has weekly inspections for multiple buildings. What I need to do is break these down by the week of the...
7
by: ajaydesai | last post by:
I have JavaScript code to dispaly two month calendar days at a time, but i have a problem both month that disaplay at a time have same days (for example May and June has same days, June and July have...
5
by: wugon.net | last post by:
question: db2 LUW V8 UNION ALL with table function month() have bad query performance Env: db2 LUW V8 + FP14 Problem : We have history data from 2005/01/01 ~ 2007/05/xx in single big...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.