<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: The 5 laws of API dates and times	</title>
	<atom:link href="/2013/03/20/5-laws-api-dates-and-times/feed/" rel="self" type="application/rss+xml" />
	<link>/2013/03/20/5-laws-api-dates-and-times/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=5-laws-api-dates-and-times</link>
	<description>Everything about API User Experience</description>
	<lastBuildDate>Mon, 13 Jun 2016 09:00:46 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.3</generator>
	<item>
		<title>
		By: The 5 laws of API dates and times &#124; Topic &#124; Sc...		</title>
		<link>/2013/03/20/5-laws-api-dates-and-times/#comment-11851</link>

		<dc:creator><![CDATA[The 5 laws of API dates and times &#124; Topic &#124; Sc...]]></dc:creator>
		<pubDate>Mon, 13 Jun 2016 09:00:46 +0000</pubDate>
		<guid isPermaLink="false">/?p=73#comment-11851</guid>

					<description><![CDATA[[&#8230;] Let&#039;s say you&#039;re building your first API. Be it public, private, or some hybrid thereof, don&#039;t be surprised if your first defect is date/time-related. Do not underestimate how much trouble you can ...&#160; [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] Let&#039;s say you&#039;re building your first API. Be it public, private, or some hybrid thereof, don&#039;t be surprised if your first defect is date/time-related. Do not underestimate how much trouble you can &#8230;&nbsp; [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Writing OpenAPI (Swagger) Specification Tutorial &#8211; Part 4 &#8211; Advanced Data Modeling &#124; API Handyman		</title>
		<link>/2013/03/20/5-laws-api-dates-and-times/#comment-11346</link>

		<dc:creator><![CDATA[Writing OpenAPI (Swagger) Specification Tutorial &#8211; Part 4 &#8211; Advanced Data Modeling &#124; API Handyman]]></dc:creator>
		<pubDate>Sun, 17 Apr 2016 15:52:44 +0000</pubDate>
		<guid isPermaLink="false">/?p=73#comment-11346</guid>

					<description><![CDATA[[&#8230;] should read the 5 laws of API dates and times by Jason Harmon to learn how to handle date and time with an [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] should read the 5 laws of API dates and times by Jason Harmon to learn how to handle date and time with an [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Stephan Smith		</title>
		<link>/2013/03/20/5-laws-api-dates-and-times/#comment-10416</link>

		<dc:creator><![CDATA[Stephan Smith]]></dc:creator>
		<pubDate>Sat, 12 Dec 2015 00:04:00 +0000</pubDate>
		<guid isPermaLink="false">/?p=73#comment-10416</guid>

					<description><![CDATA[Great article. I am using moment.js and found the following helped solidify how to accept any TZ, store in UTC and return UTC.

/* 1. Gets the local date time in ISO-8601 format. ex: &quot;2015-12-11T18:52:59-05:00&quot; */
var localDateTime = moment().format();

/* 2. POST to the API Body: { date: &quot;2015-12-11T18:52:59-05:00&quot; } */
 
/* 3. On Server convert the localtime to UTC: &quot;2015-12-11T23:52:59+00:00&quot; */
var UTCTime = moment.utc(req.body.date).format();

/* 4. Store the UTCTime in the DB. */

/* 5. Returned to the user in an JSON */
/* res.json( { date: &quot;2015-12-11T23:52:59+00:00&quot; } ); */

/* 6. Testing in the Browser: */
var localDateTime2 = moment(&quot;2015-12-11T23:52:59+00:00&quot;).format();

/* Assert we got a UTC that converts back into a local time we originally sent. */
localTime == localTime2

This should be to specific moment commands for local and server side dates.

Anyone?]]></description>
			<content:encoded><![CDATA[<p>Great article. I am using moment.js and found the following helped solidify how to accept any TZ, store in UTC and return UTC.</p>
<p>/* 1. Gets the local date time in ISO-8601 format. ex: &#8220;2015-12-11T18:52:59-05:00&#8221; */<br />
var localDateTime = moment().format();</p>
<p>/* 2. POST to the API Body: { date: &#8220;2015-12-11T18:52:59-05:00&#8221; } */</p>
<p>/* 3. On Server convert the localtime to UTC: &#8220;2015-12-11T23:52:59+00:00&#8221; */<br />
var UTCTime = moment.utc(req.body.date).format();</p>
<p>/* 4. Store the UTCTime in the DB. */</p>
<p>/* 5. Returned to the user in an JSON */<br />
/* res.json( { date: &#8220;2015-12-11T23:52:59+00:00&#8221; } ); */</p>
<p>/* 6. Testing in the Browser: */<br />
var localDateTime2 = moment(&#8220;2015-12-11T23:52:59+00:00&#8221;).format();</p>
<p>/* Assert we got a UTC that converts back into a local time we originally sent. */<br />
localTime == localTime2</p>
<p>This should be to specific moment commands for local and server side dates.</p>
<p>Anyone?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Build a Better API &#124; Mahmoud Zalt (BLOG)		</title>
		<link>/2013/03/20/5-laws-api-dates-and-times/#comment-9064</link>

		<dc:creator><![CDATA[Build a Better API &#124; Mahmoud Zalt (BLOG)]]></dc:creator>
		<pubDate>Tue, 11 Aug 2015 16:43:24 +0000</pubDate>
		<guid isPermaLink="false">/?p=73#comment-9064</guid>

					<description><![CDATA[[&#8230;]  http://restcookbook.com/Basics/caching/ /2013/03/20/5-laws-api-dates-and-times/  Don&#039;t forget to share it.   Posted in API, [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;]  <a href="http://restcookbook.com/Basics/caching/" rel="nofollow ugc">http://restcookbook.com/Basics/caching/</a> <a href="/2013/03/20/5-laws-api-dates-and-times/" rel="nofollow ugc">/2013/03/20/5-laws-api-dates-and-times/</a>  Don&#039;t forget to share it.   Posted in API, [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: When API time zones make the difference		</title>
		<link>/2013/03/20/5-laws-api-dates-and-times/#comment-243</link>

		<dc:creator><![CDATA[When API time zones make the difference]]></dc:creator>
		<pubDate>Wed, 11 Sep 2013 16:00:30 +0000</pubDate>
		<guid isPermaLink="false">/?p=73#comment-243</guid>

					<description><![CDATA[[&#8230;] APIs is hard. I&#8217;ve posted before about some of the pitfalls of dates and times in APIs in The 5 Laws of API Dates and Times, as well as content and currency localization in How to Localize Your API . One area that I did not [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] APIs is hard. I&#8217;ve posted before about some of the pitfalls of dates and times in APIs in The 5 Laws of API Dates and Times, as well as content and currency localization in How to Localize Your API . One area that I did not [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: How to localize your API &#124; API UX		</title>
		<link>/2013/03/20/5-laws-api-dates-and-times/#comment-76</link>

		<dc:creator><![CDATA[How to localize your API &#124; API UX]]></dc:creator>
		<pubDate>Thu, 25 Apr 2013 16:27:50 +0000</pubDate>
		<guid isPermaLink="false">/?p=73#comment-76</guid>

					<description><![CDATA[[...] ISO 8601: Dates/times (lots more info on this area in my article &#8220;5 laws of API dates and times&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] ISO 8601: Dates/times (lots more info on this area in my article &#8220;5 laws of API dates and times&#8221; [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: What&#8217;s the time? &#124; Energimolnet&#039;s Developer Blog		</title>
		<link>/2013/03/20/5-laws-api-dates-and-times/#comment-69</link>

		<dc:creator><![CDATA[What&#8217;s the time? &#124; Energimolnet&#039;s Developer Blog]]></dc:creator>
		<pubDate>Thu, 18 Apr 2013 13:56:26 +0000</pubDate>
		<guid isPermaLink="false">/?p=73#comment-69</guid>

					<description><![CDATA[[...] Source: The 5 Laws of API dates and times [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] Source: The 5 Laws of API dates and times [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Un&#8217;Intruduzione alla Rappresentazione, Serializzazione e Gestione del Tempo nel Software &#124; Nexse SWAT Team		</title>
		<link>/2013/03/20/5-laws-api-dates-and-times/#comment-66</link>

		<dc:creator><![CDATA[Un&#8217;Intruduzione alla Rappresentazione, Serializzazione e Gestione del Tempo nel Software &#124; Nexse SWAT Team]]></dc:creator>
		<pubDate>Wed, 17 Apr 2013 14:06:02 +0000</pubDate>
		<guid isPermaLink="false">/?p=73#comment-66</guid>

					<description><![CDATA[[...] The 5 laws of API dates and times [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] The 5 laws of API dates and times [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: GDorn		</title>
		<link>/2013/03/20/5-laws-api-dates-and-times/#comment-32</link>

		<dc:creator><![CDATA[GDorn]]></dc:creator>
		<pubDate>Thu, 28 Mar 2013 00:45:56 +0000</pubDate>
		<guid isPermaLink="false">/?p=73#comment-32</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;/2013/03/20/5-laws-api-dates-and-times/#comment-23&quot;&gt;Jason Harmon&lt;/a&gt;.

Store two forms of the date.  One in UTC to enable sorting/searching across timezones, and one to store the user&#039;s actual intent.  This last form may actually require two fields in most databases; one to store the local (to the user) datetime and one to store the user&#039;s timezone.

This is also the suggestion w3c makes:
http://www.w3.org/TR/timezone/

&quot;When creating an application that can store values in the future, including recurring events, you&#039;ll need to make additional data fields to ensure that you can reconstruct the user&#039;s intentions and adapt future time values to changes in time zones and time zone rules (especially alteration of daylight saving/summer time start and stop).&quot;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="/2013/03/20/5-laws-api-dates-and-times/#comment-23">Jason Harmon</a>.</p>
<p>Store two forms of the date.  One in UTC to enable sorting/searching across timezones, and one to store the user&#8217;s actual intent.  This last form may actually require two fields in most databases; one to store the local (to the user) datetime and one to store the user&#8217;s timezone.</p>
<p>This is also the suggestion w3c makes:<br />
<a href="http://www.w3.org/TR/timezone/" rel="nofollow ugc">http://www.w3.org/TR/timezone/</a></p>
<p>&#8220;When creating an application that can store values in the future, including recurring events, you&#8217;ll need to make additional data fields to ensure that you can reconstruct the user&#8217;s intentions and adapt future time values to changes in time zones and time zone rules (especially alteration of daylight saving/summer time start and stop).&#8221;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: The 5 laws of API dates and times &#124; The code is art		</title>
		<link>/2013/03/20/5-laws-api-dates-and-times/#comment-31</link>

		<dc:creator><![CDATA[The 5 laws of API dates and times &#124; The code is art]]></dc:creator>
		<pubDate>Wed, 27 Mar 2013 08:36:22 +0000</pubDate>
		<guid isPermaLink="false">/?p=73#comment-31</guid>

					<description><![CDATA[[...] Let’s say you’re building your first API. Be it public, private, or some hybrid thereof, don’t be surprised if your first defect is date/time-related. Do not underestimate how much trouble you can get into when it comes to handling date and times. Here are some tips which might keep you out of this potential future. (more here) [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] Let’s say you’re building your first API. Be it public, private, or some hybrid thereof, don’t be surprised if your first defect is date/time-related. Do not underestimate how much trouble you can get into when it comes to handling date and times. Here are some tips which might keep you out of this potential future. (more here) [&#8230;]</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
