<commit_before>---
title: DateTimeFormatInfo object
page_title: DateTimeFormatInfo object | RadCalendar for ASP.NET AJAX Documentation
description: DateTimeFormatInfo object
slug: calendar/client-side-programming/datetimeformatinfo-object
tags: datetimeformatinfo,object
published: True
position: 8
---

# DateTimeFormatInfo object



The **DateTimeFormatInfo** object is used by the **RadCalendar** control for formatting date and time values so that they reflect the current culture. It is accessible through the **DateTimeFormatInfo** property of the [RadCalendar Client-side Object]({%slug calendar/client-side-programming/radcalendar-object%}).

>note 
The **DateTimeFormatInfo** class is defined in the **System.Globalization** namespace.
>


The following table lists the methods of the **DateTimeFormatInfo** object:


| Name | Parameters | Return Type | Description |
| ------ | ------ | ------ | ------ |
| **FormatDate** |Array (triplet), string|string|Formats a date, using the specified date and format string (see sample below).|
| **LeadZero** |integer|string|Formats the integer, adding a leading zero if necessary so that the integer is a minimum of two digits.|

````JavaScript
<script type="text/javascript">
	function OnDateSelected(sender, e) {
        var calendarDay = e.get_renderDay();
        if (calendarDay.IsSelected) {
            var selectedDate = calendarDay.get_Date();
            var calendar = $find("<%= RadCalendar1.ClientID %>");<commit_msg>fix example<commit_after>---
title: DateTimeFormatInfo object
page_title: DateTimeFormatInfo object | RadCalendar for ASP.NET AJAX Documentation
description: DateTimeFormatInfo object
slug: calendar/client-side-programming/datetimeformatinfo-object
tags: datetimeformatinfo,object
published: True
position: 8
---

# DateTimeFormatInfo object



The **DateTimeFormatInfo** object is used by the **RadCalendar** control for formatting date and time values so that they reflect the current culture. It is accessible through the **DateTimeFormatInfo** property of the [RadCalendar Client-side Object]({%slug calendar/client-side-programming/radcalendar-object%}).

>note 
The **DateTimeFormatInfo** class is defined in the **System.Globalization** namespace.
>


The following table lists the methods of the **DateTimeFormatInfo** object:


| Name | Parameters | Return Type | Description |
| ------ | ------ | ------ | ------ |
| **FormatDate** |Array (triplet), string|string|Formats a date, using the specified date and format string (see sample below).|
| **LeadZero** |integer|string|Formats the integer, adding a leading zero if necessary so that the integer is a minimum of two digits.|

````JavaScript
<script type="text/javascript">
	function OnDateSelected(sender, e) {
        var calendarDay = e.get_renderDay();
        if (calendarDay.IsSelected) {
            var selectedDate = calendarDay.get_date();
            var calendar = $find("<%= RadCalendar1.ClientID %>");
{'fraction_non_alphanumeric': 0.11621621621621622, 'fraction_numerical': 0.0013513513513513514, 'mean_word_length': 4.483333333333333, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3141483', 'n_tokens_mistral': 774, 'n_tokens_neox': 735, 'n_words': 279}