title: Get local datetime instead of server DateTime in server side code C#
body: <p>I am using ASP MVC 4.5. I have view to input payment details. I use C# to get current time when user input payment. But after hosting it on server, i found a hot error. It gets another dateTime (may be my server's time) instead of my user's local time! 
  I want to get user's current time using C#. Should i use C# or javascript?
  I think it is easy to get user's time using javascript. But i want to use C# for this. Can you help me?
  My web API:</p>
  
  <pre><code> // POST api/PaymentApi
      public HttpResponseMessage PostPayment(Payment payment)
      {
          if (ModelState.IsValid)
          {
             var mem= db.Members.Where(m =&gt; m.MemberID.Equals(payment.MemberID)).FirstOrDefault();
  
             if (mem ==null)
              {
                  return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
              }
  
  
             payment.Date = DateTime.Now;
              db.Payments.Add(payment);
              db.SaveChanges();
  
              HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, payment);
              response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = payment.PaymentID }));
              return response;
          }
          else
          {
              return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
          }
      }
  </code></pre>
  
  <p>I used   <code>payment.Date = DateTime.Now.ToLocalTime();</code> also but not worked!</p>
  
  <p>Many of here answered to use javascript date. That's why i used it. But javascript sends a datetime and my WebApi makes it slightly different.<br>
  Javascript: <code>Date:Tue Dec 27 2016 11:04:12 GMT+0600 (Local Standard Time)</code>
  C#: <code>Date:{27/12/2016 05:04:12}</code>
  <a href="https://i.stack.imgur.com/dMQAt.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dMQAt.jpg" alt="enter image description here"></a></p>