Hi Ameet,
Thank you for contacting Syncfusion support.
We have checked with your requirement and prepared the sample for converting the provided date value in UTC time zone to CST timezone. Here, the initial value set to the DateTimePicker component is converted to UTC value and this UTC value is converted into CST time zone value by using CST time zone offset(-6) value as shown below.
export class DefaultDateTimePickerComponent {
@ViewChild('datetime')
public datetimeObj: DateTimePickerComponent;
onCreate(args) {
let a = new Date("1/1/2019 10:00 PM"); // get UTC time in msec
let utc = a.getTime() + (a.getTimezoneOffset() * 60000); // using CST offset and assign the value to the DateTimePicker // -6 is offset of CST time zone
this.datetimeObj.value = new Date(utc + (3600000 * -6));
}
}
|
Sample Link:
If we misunderstood your query or still facing issues, please revert us along with below details so that we can provide the exact solution at the earliest.
1. Issue reproducing sample or code snippets
2. How date value is passed to the server?
3. Which back-end being used in your application (Web API in C# or any other angular method)?
4. How values get stored in the database?
5. Which type of value did been returned from the server?
Regards,
Silambarasan