<?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>Codedrop™ Weblog &#187; DOS</title>
	<atom:link href="http://www.codedrop.ca/blog/archives/tag/dos/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codedrop.ca/blog</link>
	<description>Drop'n some code and other tech tidbits...</description>
	<lastBuildDate>Sun, 01 Jan 2012 07:48:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Getting &#8216;YYYYMMDDhhmmss&#8217; date format in a MS Windows script&#8230; yuck!</title>
		<link>http://www.codedrop.ca/blog/archives/216</link>
		<comments>http://www.codedrop.ca/blog/archives/216#comments</comments>
		<pubDate>Fri, 05 Mar 2010 00:21:22 +0000</pubDate>
		<dc:creator>groll</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[DOS]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/?p=216</guid>
		<description><![CDATA[I had the painful experience of recently having to update some windows .bat scripts with some new functionality&#8230;. I&#8217;ve pleasantly re-affirmed why I DON&#8217;T WORK ON A WINDOWS PLATFORM!&#8230; In any event, for any of you poor suckers that do and need access to datetime components within a batch, here&#8217;s an ugly solution&#8230; If you [...]]]></description>
			<content:encoded><![CDATA[<p>I had the painful experience of recently having to update some windows .bat scripts with some new functionality&#8230;. I&#8217;ve pleasantly re-affirmed why I DON&#8217;T WORK ON A WINDOWS PLATFORM!&#8230; </p>
<p>In any event, for any of you poor suckers that do and need access to datetime components within a batch, here&#8217;s an ugly solution&#8230; If you know of a better way.. I&#8217;m all ears!</p>
<p><code>echo %DATE% %TIME% > datefile.txt<br />
REM parse Datefile (format mon MM-DD-YYYY (US date and time setting default))<br />
For /F "tokens=2,3,4 delims=/ " %%a in (datefile.txt) do (set CurrentMonth=%%a&#038;&#038; set currentDate=%%b&#038;&#038; set /A currentYear=%%c)<br />
For /F "tokens=3,4,5 delims=: " %%a in (datefile.txt) do (set CurrentHour=%%a&#038;&#038; set currentMinute=%%b&#038;&#038; set currentSecond=%%c)<br />
echo Timstamp is: %CurrentYear%%CurrentMonth%%CurrentDate%%CurrentHour%%CurrentMinute%%CurrentSecond%<br />
</code></p>
<p>God help us all thats fugly!</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Getting+%E2%80%98YYYYMMDDhhmmss%E2%80%99+date+format+in+a+MS+Windows+script%E2%80%A6+yuck%21+http%3A%2F%2Ftinyurl.com%2F62h7d3c" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Getting+%E2%80%98YYYYMMDDhhmmss%E2%80%99+date+format+in+a+MS+Windows+script%E2%80%A6+yuck%21+http%3A%2F%2Ftinyurl.com%2F62h7d3c" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/216/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

