<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>#CONVERTINGDATES Archives - All that research...</title>
	<atom:link href="https://www.allthatresearch.com/tag/convertingdates/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.allthatresearch.com</link>
	<description>Some research is useful-</description>
	<lastBuildDate>Wed, 30 Sep 2020 00:03:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.13</generator>
	<item>
		<title>[STATA] Converting Dates</title>
		<link>https://www.allthatresearch.com/stata-converting-dates/</link>
					<comments>https://www.allthatresearch.com/stata-converting-dates/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 28 Sep 2020 16:20:21 +0000</pubDate>
				<category><![CDATA[STATA]]></category>
		<category><![CDATA[#CONVERTINGDATES]]></category>
		<category><![CDATA[#DATE]]></category>
		<category><![CDATA[#STATA]]></category>
		<category><![CDATA[#STRINGDATE]]></category>
		<guid isPermaLink="false">http://www.allthatresearch.com/?p=55</guid>

					<description><![CDATA[As a researcher, I get data with various data formatting- And it was always annoying to convert the dates because I would often forget the codes- So here I share the codes to convert various string dates to STATA format dates. Convert DD/MM/YYYY: gen numeric_date=date(string_date, “DMY”) Convert YYYY-MM-DD or YYYYMMDD: <a href="https://www.allthatresearch.com/stata-converting-dates/" class="btn btn-link continue-link">Continue Reading</a>]]></description>
										<content:encoded><![CDATA[
<p>As a researcher, I get data with various data formatting- And it was always annoying to convert the dates because I would often forget the codes- </p>



<p>So here I share the codes to convert various string dates to STATA format dates.</p>



<ol><li>Convert DD/MM/YYYY: <strong>gen numeric_date=date(string_date, “DMY”)</strong></li><li>Convert YYYY-MM-DD or YYYYMMDD: <strong>gen numeric_date=date(string_date, &#8220;YMD&#8221;)</strong></li></ol>



<p>These commands should take care most of the issues-</p>



<p>If you have a numeric YYYYMMDD then use<strong> tostring num_date</strong>, replace  then use the <strong>date </strong>command.</p>



<p>Don&#8217;t forget to format your date.</p>



<p><strong>format numeric_date %d</strong></p>



<p>Another trick is to import the data to excel, which will recognize the dates and then import that excel file to STATA. </p>



<p>Hope this tip saves some time. </p>



<p>Remember our time is limited and are resources are scarce. </p>



<p>Assuming we live about to 80 years, we have 700,800 hrs&#8230;so one hour saved is GREAT NEWS!</p>



<p>Thank You Jesus for all Your love and wisdom. Let us always enjoy Your gift of life- Amen!</p>



<p>If you enjoy the content, you can support the blog through clicking the referral links that I use in my life: <a href="https://www.acorns.com/invite/AXB4P5">Acorns</a>, <a href="https://join.robinhood.com/pureumk">Robinhood</a>, <a href="http://refer.amex.us/PUREUK1Mku?xl=cp01">American Express</a>, <a href="https://www.evernote.com/referral/Registration.action?sig=664b4b77ccc6cd9ca2f36f3a3e2acc85bc5e3a24b5156eedd03d4f58196dddbf&amp;uid=45914211">evernote</a>, and <a href="https://www.scribd.com/g/aprkl">Scribd</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.allthatresearch.com/stata-converting-dates/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 10/33 objects using disk
Page Caching using disk: enhanced 
Content Delivery Network via N/A
Database Caching 2/15 queries in 0.053 seconds using disk

Served from: www.allthatresearch.com @ 2026-04-30 08:12:42 by W3 Total Cache
-->