How to get the current date if I change the system date to the past


I need current date if the system date in past.Because if iam changing system date past my datepicker is also changed to past date but i don't want to change datepicker to my system date.My datepicker should work on current date not on system date And my datepicker should not enable for pastdates

This is my date picker code:

var usTimeZoneVal = new Date().toLocaleString('en-US', { timeZone: 'America/New_York' });
            $('#datetimepicker2 , #datetimepicker3')
                        autoclose: true,
                        todayHighlight: true,
                        format: 'yyyy/mm/dd',
                        //startDate: '+0d'
                        startDate: usTimeZoneVal
                .on('changeDate', function (e) {
                    $('#GuestSearchForm').bootstrapValidator('revalidateField', 'Servicedate');

And this is my Controller code:

public ActionResult GetServiceProviders(RankedServices.Entities.Admin.Services Services)
            // if (Services != null && Services.SelectedServiceIds != null)

            string ServiceDate = Services.Servicedate.ToString("MM/dd/yyyy");/*Start Added by Arun 13-April-2017*/
            DateTime USDates = Convert.ToDateTime(Services.USdate);
            string USDate = USDates.ToString("MM/dd/yyyy");

            int FutureDate = DateTime.Compare(Convert.ToDateTime(ServiceDate), Convert.ToDateTime(USDate));/* End*/

            if (Services != null && (Services.SelectedServiceIds != null || Services.ServiceIds != null) && FutureDate >= 0)
                if (Services.SelectedServiceIds != null)
                    Services.ServiceIds = string.Join(",", Services.SelectedServiceIds);

                //  Services.ServiceIds = string.Join(",", Services.SelectedServiceIds);zz

                if (Services.ServiceIds != "" && (Services.SubLocationID != "" || Services.Servicedate.Date != null))
                    string UserID = "";
                    if (Session["UserID"] != null)
                        UserID = Session["UserID"].ToString();

                    Services.lstServiceProviders = ServiceDetails.GetServiceProviders(Services.SubLocationID, Services.ServiceIds.TrimEnd(','), UserID, ServiceDate, Services.Daymode, Services.ProviderID);

                    IEnumerable<RankedServices.Entities.Admin.Services> lstServices = ServiceDetails.GetServicesList(Services.SubLocationID.ToString());
                    ViewBag.SelectedServices = new MultiSelectList(lstServices, Services.SelectedServiceIds);

                    return View("ServicesList", Services);
                    //  return Json(lst, JsonRequestBehavior.AllowGet);
                    return RedirectToAction("guestsearch", "Home");
                return RedirectToAction("guestsearch", "Home"); // if none are selected re-direct to Guest-Search

You can create an ApiController, with a method that gets servers date, then using ajax request you get your data in javascript. You have here an example:

public class YourApiController : ApiController
    public DateTime GetDateFromServer()
        return DateTime.Now;

Then, in your javascript you add this:

    type: 'GET',
    context: this,
    url: '/api/getDateFromServer',
}).done(function (data) {
   //here you have date from server
   serverDate = data;