locked
Server Date RRS feed

  • Question

  • Hi all,

    Is it possible to get the server date and time by using script or something else?. If yes, give me some idea.

    Regards,
    Rajsekhar
    Tuesday, May 12, 2009 8:42 AM

Answers

  • Hi, Rajsekhar

    You can develop small aspx page and place it into ISV directory of server. Page code:

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%=DateTime.Now.ToString()%>
    And on client side using following code you can read datetime calling this page with following code:

    var httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
    var checkURL = <url to time page>;
    httpRequest.Open('GET', checkURL, false);
    httpRequest.Send(null);
    var res = httpRequest.responseText;
    
    You will retrieve text of server date time in variable res.

    Truth opens to prepared mind. My blog - http://a33ik.blogspot.com
    Tuesday, May 12, 2009 8:58 AM
    Moderator

All replies

  • Hi, Rajsekhar

    You can develop small aspx page and place it into ISV directory of server. Page code:

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%=DateTime.Now.ToString()%>
    And on client side using following code you can read datetime calling this page with following code:

    var httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
    var checkURL = <url to time page>;
    httpRequest.Open('GET', checkURL, false);
    httpRequest.Send(null);
    var res = httpRequest.responseText;
    
    You will retrieve text of server date time in variable res.

    Truth opens to prepared mind. My blog - http://a33ik.blogspot.com
    Tuesday, May 12, 2009 8:58 AM
    Moderator
  • Hi,

    It returns system date only
    Tuesday, May 12, 2009 9:03 AM
  • k. I got it. Now I understood.
    Tuesday, May 12, 2009 9:07 AM
  • Hi a33ik,

    Is it necessary to bulid the website and copy that .dll file into CRM bin folder?. I did like this.

    -> .aspx page is created and run it
    -> copy the url (ex: http://localhost:50082/serverdate/Default.aspx)
    -> provide that url in webservice code as u said
    -> copy the .aspx page into ISV folder
    -> write that webservice code in Form Onload Event.


    Is this the correct way or any thing else?


    Regards,
    Rajsekhar.
    Wednesday, May 13, 2009 4:06 AM
  • Hi.

    Yes. It is required.
    Truth opens to prepared mind. My blog - http://a33ik.blogspot.com
    Wednesday, May 13, 2009 4:11 AM
    Moderator
  • One more doubt. In the place of checkUrl what I provide that url or file path. I provide URL.

    Wednesday, May 13, 2009 4:18 AM
  • Hi.

    You have to provide a url. Something like http://[your crmserver]:[port]/[your organization name]/ISV/ServerDate.aspx
    Truth opens to prepared mind. My blog - http://a33ik.blogspot.com
    Wednesday, May 13, 2009 5:24 AM
    Moderator