title: Converting my javascript datetime to UTC from PST
body: <p>I'm going out of my mind dealing with my local (PST) time zone and making calls to a webservice that is in UTC.</p>
  
  <p>The webservice takes a start and end date in format of "2011-02-09T12:00:00", and the current code uses starttime=30 days ago, and endtime=now.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>var s = new Date(); 
  var e = new Date(); 
  
  s.setTime(d.getTime() - 30 * 24 * 60 * 60 * 1000);
  
  var startdate = String.Format("datetime'{0:df(yyyy-MM-dd)}T{0:df(HH:mm:ss)}'", s);  
  var enddate = String.Format("datetime'{0:df(yyyy-MM-dd)}T{0:df(HH:mm:ss)}'", e);
  
  var url = String.Format("http://foo.com/webservice.svc/data?start={1}&amp;end={2}&amp;$format=json", startdate, enddate);
  var obj = GetJsonObjectFromServer(url);
  </code></pre>
  
  <p>I've tried just adding 25,200,000 ms to d and b but that's resulting in s being returned as an invalid date (presumably because it's putting it in the future maybe?).</p>
  
  <p>Since it's using PST, my local time zone, the webservice I'm passing these params into isn't returning all the data since it's missing an 8 hour span since server is in UTC.</p>
  
  <p>I've tried a bunch of UTC methods, but problem is getting it back into the format I need for the webservice.  I'd appreciate more direct guidance instead of just pointing to Javascript UTC methods.</p>
  
  <p>There's something simple I'm missing here and would love help!</p>