We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

UTC Offset Question

Thread ID:

Created:

Updated:

Platform:

Replies:

146686 Aug 14,2019 06:30 AM UTC Aug 19,2019 09:37 AM UTC ASP.NET Core - EJ 2 3
loading
Tags: DateTime Picker
Mark Tannehill
Asked On August 14, 2019 06:30 AM UTC

I have a creation form that takes 2x dates.

@model directoryData.ViewModels.SessionViewModel

@{
    ViewData["Title"] = "Create";
}
<h4>Create New Session for @Model.ClientName</h4>
<hr />
<div class="row" style="margin: 10px">
    <div class="col-md-4">

        <form asp-action="Create" asp-controller="Session" method="post" asp-route-session="@Model.Session">
            <input asp-for="@Model.Session.ClientId" class="form-control" style="display: none" />
            <ejs-datetimepicker id="startdatetimepicker" placeholder="Select a date and time" ejs-for="@Model.Session.StartTime"  ></ejs-datetimepicker>
            <ejs-datetimepicker id="enddatetimepicker" placeholder="Select a date and time" ejs-for="@Model.Session.EndTime"  ></ejs-datetimepicker>
            <div class="form-group">
                <input type="submit" value="Create Session" class="btn btn-primary"/>
            </div>
        </form>
    
    </div>
</div>

Here is my model:

  public class Session : EntityBase
    {
        [Key]
        public int SessionId { get; set; }

        [Required]
        public Guid ClinicId{ get; set; }
        [Required]
        public Guid ClientId { get; set; }
        [Required]
        public Guid EmployeeId { get; set; }
        [Required]
        public int DeviceId { get; set; }

        [Required] public DateTimeOffset StartTime { get; set; } = DateTimeOffset.Now;

        [Required]
        public DateTimeOffset EndTime { get; set; } = DateTimeOffset.Now.AddHours(4);

        public string Note { get; set; }
    }

When I debug locally, my time comes through with the UTC offset attached (2019-08-12 23:36:00.0000000 -06:00)
otherwise, when published, the time comes through without the offset (2019-08-12 23:36:00.0000000 00:00)

How do I get the website (client) to understand the UTC offset to send when creating a new session?

Thanks.



Gopi Govindasamy [Syncfusion]
Replied On August 15, 2019 01:22 PM UTC

Hi Mark,  

Greetings from Syncfusion support. 

We have checked your reported problem at our end. But unfortunately, we were unable to replicate at our end. We suspect the cause of the problem due to on timezhone not same your client and server hosted machine(publish machine). Can you please ensure whether you have specify the same timezhone  to client and server(publish) machine. If still you are facing this problem, please provide below information to reproduce your issue at our end. 

  1. Application hosted link.
  2. timezhone details.
  3. screenshot for client and server machine timezhone.

Regards,
Gopi G. 


Mark Tannehill
Replied On August 16, 2019 08:58 PM UTC

I think I have nearly solved my issue. The client needs to pass an offset to my controller so when I store time, I know correct UTC with that.

Thanks for your help. I will reopen another ticket in the correct control.

Ashokkumar Balasubramanian [Syncfusion]
Replied On August 19, 2019 09:37 AM UTC

Hi Mark, 
 
We are glad to hear the problem has been resolved. Please let us know, if you need any further assistance. 
 
Regards, 
Ashokkumar B. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon