Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ The DatePicker component displays and maintains the selected date value based on

N> if the system time zone is changed dynamically after a value is selected, the DatePicker will **not update or shift** the selected value. The component preserves the original selection, ensuring a stable and reliable user experience.

## Using `serverTimezoneOffset`
## `serverTimezoneOffset`

The `serverTimezoneOffset` property allows you to specify the server's time zone offset from UTC in **hours** or **fractional hours**. This is useful when binding values from the server to ensure they are interpreted correctly on the client side.

### Key Points

- The value should be a number representing the offset from UTC.
- Examples:
- `-5` → UTC-5 (Eastern Standard Time)
Expand Down
41 changes: 41 additions & 0 deletions ej2-asp-core-mvc/datepicker/EJ2_ASP.NETCORE/timezone-behavior.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
layout: post
title: Timezone Behavior in ##Platform_Name## Datepicker | Syncfusion
description: Learn here all about Timezone Behavior in Syncfusion ##Platform_Name## Datepicker component of Syncfusion Essential JS 2 and more.
platform: ej2-asp-core-mvc
control: Timezone Behavior
publishingplatform: ##Platform_Name##
documentation: ug
---

# Timezone Behavior in DatePicker Control

The DatePicker component displays and maintains the selected date value based on the client system’s current time zone. When a user selects a value, it is stored and rendered using the local time zone of the system at the time of selection. This ensures that the value remains consistent and predictable during user interaction.

N> if the system time zone is changed dynamically after a value is selected, the DatePicker will **not update or shift** the selected value. The component preserves the original selection, ensuring a stable and reliable user experience.

## `serverTimezoneOffset`

The `serverTimezoneOffset` property allows you to specify the server's time zone offset from UTC in **hours** or **fractional hours**. This is useful when binding values from the server to ensure they are interpreted correctly on the client side.

- The value should be a number representing the offset from UTC.
- Examples:
- `-5` → UTC-5 (Eastern Standard Time)
- `-4.5` → UTC-4:30 (Afghanistan Time)
- `5.5` → UTC+5:30 (India Standard Time)

N> The `serverTimezoneOffset` property is applicable **only for pre-bound values** (i.e., values set during initialization or data binding). It does **not affect** values selected by the user during runtime.

### Example

```ts
import { DatePicker } from '@syncfusion/ej2-calendars';

/* Initialize the DatePicker component */
let datepicker: DatePicker = new DatePicker({
placeholder: "Select Date",
width: "250px",
serverTimezoneOffset: 5.5 // Example: UTC+5:30 for IST
});

datepicker.appendTo('#datepicker');
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ The DateTimePicker component displays and maintains the selected date and time v

N> if the system time zone is changed dynamically after a value is selected, the DateTimePicker will **not update or shift** the selected value. The component preserves the original selection, ensuring a stable and reliable user experience.

## Using `serverTimezoneOffset`
## `serverTimezoneOffset`

The `serverTimezoneOffset` property allows you to specify the server's time zone offset from UTC in **hours** or **fractional hours**. This is useful when binding values from the server to ensure they are interpreted correctly on the client side.

### Key Points

- The value should be a number representing the offset from UTC.
- Examples:
- `-5` → UTC-5 (Eastern Standard Time)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
layout: post
title: Timezone Behavior in ##Platform_Name## Datetimepicker | Syncfusion
description: Learn here all about Timezone Behavior in Syncfusion ##Platform_Name## Datetimepicker component of Syncfusion Essential JS 2 and more.
platform: ej2-asp-core-mvc
control: Timezone Behavior
publishingplatform: ##Platform_Name##
documentation: ug
---

# Timezone Behavior in DateTimePicker Control

The DateTimePicker component displays and maintains the selected date and time value based on the client system’s current time zone. When a user selects a value, it is stored and rendered using the local time zone of the system at the time of selection. This ensures that the value remains consistent and predictable during user interaction.

N> if the system time zone is changed dynamically after a value is selected, the DateTimePicker will **not update or shift** the selected value. The component preserves the original selection, ensuring a stable and reliable user experience.

## `serverTimezoneOffset`

The `serverTimezoneOffset` property allows you to specify the server's time zone offset from UTC in **hours** or **fractional hours**. This is useful when binding values from the server to ensure they are interpreted correctly on the client side.

- The value should be a number representing the offset from UTC.
- Examples:
- `-5` → UTC-5 (Eastern Standard Time)
- `-4.5` → UTC-4:30 (Afghanistan Time)
- `5.5` → UTC+5:30 (India Standard Time)

N> The `serverTimezoneOffset` property is applicable **only for pre-bound values** (i.e., values set during initialization or data binding). It does **not affect** values selected by the user during runtime.

### Example

```ts
import { DateTimePicker } from '@syncfusion/ej2-calendars';

/* Initialize the DateTimePicker component */
let datetimepicker: DateTimePicker = new DateTimePicker({
placeholder: "Select Date Time",
width: "250px",
serverTimezoneOffset: 5.5 // Example: UTC+5:30 for IST
});

datetimepicker.appendTo('#datetimepicker');
3 changes: 3 additions & 0 deletions ej2-asp-core-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@
<li><a href="/ej2-asp-core/datepicker/view">Start and Depth View</a></li>
<li><a href="/ej2-asp-core/datepicker/accessibility">Accessibility</a></li>
<li><a href="/ej2-asp-core/datepicker/style-appearance">Style and Appearance</a></li>
<li><a href="/ej2-asp-core/datepicker/timezone-behavior">Timezone Behavior</a></li>
<li>How To
<ul>
<li><a href="/ej2-asp-core/datepicker/how-to/disabled-the-datepicker-component">Disabled the DatePicker Component</a></li>
Expand Down Expand Up @@ -853,6 +854,8 @@
<li><a href="/ej2-asp-core/datetimepicker/globalization">Globalization</a></li>
<li><a href="/ej2-asp-core/datetimepicker/accessibility">Accessibility</a></li>
<li><a href="/ej2-asp-core/datetimepicker/style-appearance">Style and Appearance</a></li>
<li><a href="/ej2-asp-core/datetimepicker/timezone-behavior">Timezone Behavior</a></li>

<li>How To
<ul>
<li><a href="/ej2-asp-core/datetimepicker/how-to/disable-the-datetimepicker-component">Disable the DateTimePicker Component</a></li>
Expand Down