{"id":503,"date":"2009-08-07T20:13:37","date_gmt":"2009-08-08T01:13:37","guid":{"rendered":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/?p=503"},"modified":"2019-12-10T15:00:13","modified_gmt":"2019-12-10T20:00:13","slug":"6-ways-to-work-with-dates-in-javascript","status":"publish","type":"post","link":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/?p=503","title":{"rendered":"6 Ways To Work With Dates In JavaScript"},"content":{"rendered":"<p>Yesterday I added another AJAX demonstration to my web site using the Reddit API. <a title=\"http:\/\/www.williamsportwebdeveloper.com\/reddit.html\" href=\"http:\/\/www.williamsportwebdeveloper.com\/reddit.html\">http:\/\/www.williamsportwebdeveloper.com\/reddit.html<\/a> The reddit API provides dates in the UTC number format which forced me to spend some time figuring out how to convert it into other date formats. Since I frequently deal with different date formats in JavaScript I decided to do some research on the topic and add a cheatsheet to my notes. I might as well share it with you because I don&#8217;t share this kind of knowledge often enough.<\/p>\n<h1>Get Current Date\/Time<\/h1>\n<p>The first example just shows you how to get the current date and time. Note that this can vary slightly depending upon the browser. Also, it does not factor in your time zone.<\/p>\n<div style=\"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;\">\n<div style=\"line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\">\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   1:<\/span> <span style=\"color: #0000ff;\">function<\/span> fnNow() {<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   2:<\/span>     <span style=\"color: #0000ff;\">var<\/span> now = <span style=\"color: #0000ff;\">new<\/span> Date();<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   3:<\/span>     alert(now);<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   4:<\/span> }<\/pre>\n<\/div>\n<\/div>\n<pre>Thu Aug 6 22:49:52 EDT 2009 \r\nThu Aug 06 2009 19:43:34 GMT-0400 (Eastern Daylight Time)<\/pre>\n<h1>UTC (Coordinated Universal Time) String<\/h1>\n<p>This example gets the date and time in a slightly different string format.<\/p>\n<div style=\"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;\">\n<div style=\"line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\">\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   1:<\/span> <span style=\"color: #0000ff;\">function<\/span> fnUTCString() {<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   2:<\/span>     <span style=\"color: #0000ff;\">var<\/span> now = <span style=\"color: #0000ff;\">new<\/span> Date();<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   3:<\/span>     alert(now.toUTCString());<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   4:<\/span> }<\/pre>\n<\/div>\n<\/div>\n<pre>Thu, 6 Aug 2009 22:49:52 UTC \r\nThu, 06 Aug 2009 23:44:14 GMT<\/pre>\n<h1>UTC (Coordinated Universal Time) Number<\/h1>\n<p>The UTC() method takes a date and returns the number of milliseconds since midnight of January 1, 1970 according to universal time. 10 to 13 digits, last 3 digits for miliseconds.<\/p>\n<p><b>Syntax:<\/b> Date.UTC(year,month,day,hours,minutes,seconds,ms)<\/p>\n<div style=\"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;\">\n<div style=\"line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\">\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   1:<\/span> <span style=\"color: #0000ff;\">function<\/span> fnUTC() {<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   2:<\/span>     <span style=\"color: #0000ff;\">var<\/span> now = <span style=\"color: #0000ff;\">new<\/span> Date();<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   3:<\/span>     <span style=\"color: #0000ff;\">var<\/span> d = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   4:<\/span>     alert(d);<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   5:<\/span> }<\/pre>\n<\/div>\n<\/div>\n<p>The example above converts a UTC date in the numerical format, 1249585988774, into the string format. This is what I needed to work with the Reddit API.<\/p>\n<pre>1249585988774<\/pre>\n<h1>ISO 8601<\/h1>\n<p><strong>ISO 8601<\/strong>. Note that the &#8220;T&#8221; appears literally in the string, to indicate the beginning of the time element. Times are expressed in UTC (Coordinated Universal Time), with a special UTC designator (&#8220;Z&#8221;). Used in ATOM RSS feeds.<\/p>\n<div style=\"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;\">\n<div style=\"line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\">\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   1:<\/span> <span style=\"color: #0000ff;\">function<\/span> fnISO() {<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   2:<\/span>     <span style=\"color: #008000;\">\/\/ Only works in Firefox using ECMAScript 5<\/span><\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   3:<\/span>     <span style=\"color: #0000ff;\">var<\/span> now = <span style=\"color: #0000ff;\">new<\/span> Date().toISOString();<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   4:<\/span>     alert(now);<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   5:<\/span> }<\/pre>\n<\/div>\n<\/div>\n<p>As noted in the code comment above, ECMAScript 5 will support the <em>toISOString()<\/em> method. Firefox 3.5 appears to be the only browser with a JavaScript engine that has this method for the Date object. This will make it easier to convert dates into the proper format for RSS feeds.<\/p>\n<pre>2009-08-06T23:36:31.390Z<\/pre>\n<h1>UTC Number To JavaScript Date<\/h1>\n<p>In the following sample code, I finally factor in my time zone and convert an UTC date in the numerical format into a regular JavaScript Date object.<\/p>\n<div style=\"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;\">\n<div style=\"line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\">\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   1:<\/span> <span style=\"color: #0000ff;\">function<\/span> fnUTC2Date() {<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   2:<\/span>     <span style=\"color: #0000ff;\">var<\/span> now = <span style=\"color: #0000ff;\">new<\/span> Date();<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   3:<\/span>     <span style=\"color: #0000ff;\">var<\/span> d = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   4:<\/span>     <span style=\"color: #008000;\">\/\/ obtain local UTC offset and convert to msec<\/span><\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   5:<\/span>     localOffset = now.getTimezoneOffset() * 60000;<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   6:<\/span>     <span style=\"color: #0000ff;\">var<\/span> c = <span style=\"color: #0000ff;\">new<\/span> Date(d + localOffset);<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   7:<\/span>     alert(c.toLocaleString());<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   8:<\/span> }<\/pre>\n<\/div>\n<\/div>\n<h1>JavaScript Date To ISO8601<\/h1>\n<p>Since the <em>toISOString()<\/em> method is not available for Internet Explorer yet you will need to reformat a date into the ISO 8601 format yourself. The following code is just one way to accomplish this:<\/p>\n<div style=\"line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;\">\n<div style=\"line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\">\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   1:<\/span> <span style=\"color: #0000ff;\">function<\/span> padzero(n) {<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   2:<\/span>     <span style=\"color: #0000ff;\">return<\/span> n &lt; 10 ? <span style=\"color: #006080;\">'0'<\/span> + n : n;<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   3:<\/span> }<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   4:<\/span> <span style=\"color: #0000ff;\">function<\/span> pad2zeros(n) {<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   5:<\/span>     <span style=\"color: #0000ff;\">if<\/span> (n &lt; 100) {<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   6:<\/span>         n = <span style=\"color: #006080;\">'0'<\/span> + n;<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   7:<\/span>     }<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   8:<\/span>     <span style=\"color: #0000ff;\">if<\/span> (n &lt; 10) {<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">   9:<\/span>         n = <span style=\"color: #006080;\">'0'<\/span> + n;<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">  10:<\/span>     }<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">  11:<\/span>     <span style=\"color: #0000ff;\">return<\/span> n;<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">  12:<\/span> }<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">  13:<\/span> <span style=\"color: #0000ff;\">function<\/span> toISOString(d) {<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">  14:<\/span>     <span style=\"color: #0000ff;\">return<\/span> d.getUTCFullYear() + <span style=\"color: #006080;\">'-'<\/span> +  padzero(d.getUTCMonth() + 1) + <span style=\"color: #006080;\">'-'<\/span> + padzero(d.getUTCDate()) + <span style=\"color: #006080;\">'T'<\/span> + padzero(d.getUTCHours()) + <span style=\"color: #006080;\">':'<\/span> +  padzero(d.getUTCMinutes()) + <span style=\"color: #006080;\">':'<\/span> + padzero(d.getUTCSeconds()) + <span style=\"color: #006080;\">'.'<\/span> + pad2zeros(d.getUTCMilliseconds()) + <span style=\"color: #006080;\">'Z'<\/span>;<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">  15:<\/span> }<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">  16:<\/span> <span style=\"color: #0000ff;\">function<\/span> fnToISO() {<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">  17:<\/span>     <span style=\"color: #0000ff;\">var<\/span> now = <span style=\"color: #0000ff;\">new<\/span> Date();<\/pre>\n<pre style=\"line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">  18:<\/span>     alert(toISOString(now));<\/pre>\n<pre style=\"line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;\"><span style=\"color: #606060;\">  19:<\/span> }<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday I added another AJAX demonstration to my web site using the Reddit API. http:\/\/www.williamsportwebdeveloper.com\/reddit.html The reddit API provides dates in the UTC number format which forced me to spend some time figuring out how to convert it into other &hellip; <a href=\"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/?p=503\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,112,12],"tags":[365,366,1152,367],"_links":{"self":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts\/503"}],"collection":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=503"}],"version-history":[{"count":2,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts\/503\/revisions"}],"predecessor-version":[{"id":3298,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts\/503\/revisions\/3298"}],"wp:attachment":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=503"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}