title: form data passed timestamp convert to byte[] in webservice
body: <p>i have passed a timestamp through formData in jquery to a webservice. below is my js file code</p>
  
  <pre><code>function SaveNotification() {
  var data = getData();
  $.ajax({
      type: "POST",
      url: "../Webservice/General.asmx/SaveNotification",
      contentType: false,
      processData: false,        
      data: data,
      success: imgSuccess,
      error: handleResponse
  });
  }
  
  function getData() {
  var data = new FormData();
  data.append("Image", $("#fileBox")[0].files[0]);
  data.append("id", Number(notificationId));
  data.append("description",$("#txtDesc").val());
  data.append("timestamp", getTimeStamp());
  
  return data;
  }
  
  function getTimeStamp() {
  var timeStamp = [];
  if (Number(notificationId) != -1) {
      $(notifications).each(function(index, item) {
          if (item.ID == Number(notificationId)) {
              timeStamp = JSON.stringify(item.TimeStamp);
          }
      });
  }
  return timeStamp;
  }
  </code></pre>
  
  <p>now what i want is convert this timestamp to byte[]. i have used some codes but it will convert only to different byte[]. not the exact timpstamp which is created by sql server. below code is what i used to convert it to byte[] in my webservice</p>
  
  <pre><code>    if (HttpContext.Current.Request.Params["timestamp"] != "")
                      timeStamp = Encoding.ASCII.GetBytes(HttpContext.Current.Request.Params["timestamp"]);
  </code></pre>
  
  <p>in immediate window HttpContext.Current.Request.Params["timestamp"] gives "[0,0,0,0,0,0,24,174]" result which is correct but a string array. after i convert using above code it will give</p>
  
  <blockquote>
    <p>{byte[20]}
        [0]: 91
        [1]: 48
        [2]: 44
        [3]: 48
        [4]: 44
        [5]: 48
        [6]: 44
        [7]: 48
        [8]: 44
        [9]: 48
        [10]: 44
        [11]: 48
        [12]: 44
        [13]: 50
        [14]: 52
        [15]: 44
        [16]: 49
        [17]: 55
        [18]: 52
        [19]: 93</p>
  </blockquote>
  
  <p>so how can i convert timestamp to byte[] what i want to... ([0,0,0,0,0,0,24,174])</p>