Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.36 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $(function () {
  2.   $.ajax({
  3.     type: 'GET',
  4.     cache: false,
  5.     url: location.href,
  6.     complete: function (req, textStatus) {
  7.       var dateString = req.getResponseHeader('Date');
  8.       if (dateString.indexOf('GMT') === -1) {
  9.         dateString += ' GMT';
  10.       }
  11.       var date = new Date(dateString);
  12.       $('#serverTime').text(date.toString());
  13.     }
  14.   });
  15. });