Title: WP_Locale::get_month
Published: April 25, 2014
Last modified: May 20, 2026

---

# WP_Locale::get_month( string|int $month_number ): string

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#wp--skip-link--target)

Retrieves the full translated month by month number.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#description)󠁿

The $month_number parameter has to be a string because it must have the ‘0’ in front
of any number that is less than 10. Starts from ’01’ and ends at ’12’.

You can use an integer instead and it will add the ‘0’ before the numbers less than
10 for you.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#parameters)󠁿

 `$month_number`string|intrequired

`'01'` through `'12'`.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#return)󠁿

 string Translated full month name. If the month number is not found, an empty string
is returned.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#source)󠁿

    ```php
    public function get_month( $month_number ) {
    	$month_number = zeroise( $month_number, 2 );
    	if ( ! isset( $this->month[ $month_number ] ) ) {
    		return '';
    	}
    	return $this->month[ $month_number ];
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-locale.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-wp-locale.php#L320)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-wp-locale.php#L320-L326)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#related)󠁿

| Uses | Description | 
| [zeroise()](https://developer.wordpress.org/reference/functions/zeroise/)`wp-includes/formatting.php` |

Add leading zeros when necessary.

  |

| Used by | Description | 
| [wp_date()](https://developer.wordpress.org/reference/functions/wp_date/)`wp-includes/functions.php` |

Retrieves the date, in localized format.

  | 
| [WP_Customize_Date_Time_Control::get_month_choices()](https://developer.wordpress.org/reference/classes/wp_customize_date_time_control/get_month_choices/)`wp-includes/customize/class-wp-customize-date-time-control.php` |

Generate options for the month Select.

  | 
| [export_date_options()](https://developer.wordpress.org/reference/functions/export_date_options/)`wp-admin/export.php` |

Creates the date options fields for exporting a given post type.

  | 
| [WP_List_Table::months_dropdown()](https://developer.wordpress.org/reference/classes/wp_list_table/months_dropdown/)`wp-admin/includes/class-wp-list-table.php` |

Displays a dropdown for filtering items in the list table by month.

  | 
| [touch_time()](https://developer.wordpress.org/reference/functions/touch_time/)`wp-admin/includes/template.php` |

Prints out HTML form date elements for editing post or comment publish date.

  | 
| [media_upload_library_form()](https://developer.wordpress.org/reference/functions/media_upload_library_form/)`wp-admin/includes/media.php` |

Outputs the legacy media upload form for the media library.

  | 
| [single_month_title()](https://developer.wordpress.org/reference/functions/single_month_title/)`wp-includes/general-template.php` |

Displays or retrieves page title for post archive based on date.

  | 
| [wp_get_archives()](https://developer.wordpress.org/reference/functions/wp_get_archives/)`wp-includes/general-template.php` |

Displays archive links based on type and format.

  | 
| [get_calendar()](https://developer.wordpress.org/reference/functions/get_calendar/)`wp-includes/general-template.php` |

Displays calendar with days that have posts as links.

  | 
| [wp_title()](https://developer.wordpress.org/reference/functions/wp_title/)`wp-includes/general-template.php` |

Displays or retrieves page title for all areas of blog.

  | 
| [wp_enqueue_media()](https://developer.wordpress.org/reference/functions/wp_enqueue_media/)`wp-includes/media.php` |

Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs.

  |

[Show 6 more](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_locale/get_month/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_locale%2Fget_month%2F)
before being able to contribute a note or feedback.