<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Beware the Ides of March—But by Who's PowerShell Calendar?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/03/15/beware-the-ides-of-march-but-by-who-s-powershell-calendar.aspx</link><description>Learn about using Windows PowerShell and specifying different calendar types to use with dates.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Beware the Ides of March—But by Who's PowerShell Calendar?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/03/15/beware-the-ides-of-march-but-by-who-s-powershell-calendar.aspx#3487054</link><pubDate>Fri, 16 Mar 2012 10:55:01 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3487054</guid><dc:creator>rjcox</dc:creator><description>&lt;p&gt;@Richard.Siddaway&lt;/p&gt;
&lt;p&gt;Having saved me the need to note the locale dependency in the article&amp;#39;s example, there is a solution: Use ISO format. This is unambiguous with a four digit year:&lt;/p&gt;
&lt;p&gt;PS&amp;gt; [datetime]&amp;quot;2012-08-10&amp;quot;&lt;/p&gt;
&lt;p&gt;will always give you midnight 10 August 2010.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3487054" width="1" height="1"&gt;</description></item><item><title>re: Beware the Ides of March—But by Who's PowerShell Calendar?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/03/15/beware-the-ides-of-march-but-by-who-s-powershell-calendar.aspx#3486966</link><pubDate>Thu, 15 Mar 2012 20:10:13 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3486966</guid><dc:creator>K_Schulte</dc:creator><description>&lt;p&gt;Hi Ed,&lt;/p&gt;
&lt;p&gt;a good short article that explains some details of dates.&lt;/p&gt;
&lt;p&gt;It is quite ingteresting what we can do with dates and we should pay attention to date formats!&lt;/p&gt;
&lt;p&gt;@Richard: Right! Living in Germany, I encounter the same problems, you do!&lt;/p&gt;
&lt;p&gt;But there is one thing, I can asure you ... you typed in: [datetime]&amp;quot;51/3/12&amp;quot;&lt;/p&gt;
&lt;p&gt;This will never be a valid date ... not in the UK, not in the US and not here :-)))&lt;/p&gt;
&lt;p&gt;Klaus (Schulte)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3486966" width="1" height="1"&gt;</description></item><item><title>re: Beware the Ides of March—But by Who's PowerShell Calendar?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/03/15/beware-the-ides-of-march-but-by-who-s-powershell-calendar.aspx#3486945</link><pubDate>Thu, 15 Mar 2012 19:14:37 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3486945</guid><dc:creator>Richard.Siddaway</dc:creator><description>&lt;p&gt;Hi quick comment on international dates. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding&lt;/p&gt;
&lt;p&gt;[datetime]&amp;quot;3/15/12&amp;quot;&lt;/p&gt;
&lt;p&gt;The syntax shows month/day/year and results in&lt;/p&gt;
&lt;p&gt;Thursday, March 15, 2012 12:00:00 AM&lt;/p&gt;
&lt;p&gt;Living in the UK I&amp;#39;m more used to day/month/year but if I try&lt;/p&gt;
&lt;p&gt;PS&amp;gt; [datetime]&amp;quot;51/3/12&amp;quot;&lt;/p&gt;
&lt;p&gt;Cannot convert value &amp;quot;51/3/12&amp;quot; to type &amp;quot;System.DateTime&amp;quot;. Error: &amp;quot;String was not recognized as a valid DateTime.&amp;quot;&lt;/p&gt;
&lt;p&gt;I have to do&lt;/p&gt;
&lt;p&gt;[datetime]&amp;quot;3/15/12&amp;quot;&lt;/p&gt;
&lt;p&gt;Over the years I have found that its safer for me to do&lt;/p&gt;
&lt;p&gt;[datetime]&amp;quot;15 March 2012&amp;quot;&lt;/p&gt;
&lt;p&gt;as it always works.&lt;/p&gt;
&lt;p&gt;This is caused by the culture settings in PowerShell&lt;/p&gt;
&lt;p&gt;PS&amp;gt; Get-Culture&lt;/p&gt;
&lt;p&gt;LCID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DisplayName&lt;/p&gt;
&lt;p&gt;---- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ---- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -----------&lt;/p&gt;
&lt;p&gt;2057 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; en-GB &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;English (United Kingdom)&lt;/p&gt;
&lt;p&gt;PS&amp;gt; Get-UICulture&lt;/p&gt;
&lt;p&gt;LCID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DisplayName&lt;/p&gt;
&lt;p&gt;---- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ---- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -----------&lt;/p&gt;
&lt;p&gt;1033 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; en-US &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;English (United States)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3486945" width="1" height="1"&gt;</description></item></channel></rss>