<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>Eric's Blog for January 279th, 2003</title><link>http://blogs.msdn.com/ericlippert/archive/2003/10/06/53150.aspx</link><description>when I dissed the VBScript date format a few weeks ago, I never got around to dissing the similarly goofy JScript date code.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>RE: Eric's Blog for January 279th, 2003</title><link>http://blogs.msdn.com/ericlippert/archive/2003/10/06/53150.aspx#53151</link><pubDate>Mon, 06 Oct 2003 23:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:53151</guid><dc:creator>Raymond Chen</dc:creator><description>Some of the weirdness dates back to UNIX. The unix &amp;quot;struct tm&amp;quot; used a zero-based month and a 1900-biased year. So the year 2000 was represented by the value 100. This was actually good and correct - it meant that if you paid close attention and always added 1900 to the year, you always got the right answer. 

What is bogus is the various attempts to &amp;quot;fix&amp;quot; this problem by making the underlying problem unsolveable. For example, the revised getYear that returned one set of values if the year was from 1900 to 1999 and a different set otherwise meant that if you called getYear and got 80 back, you could never be sure whether that was the year 80 or the year 1980.

But the worst part of JScript dates is that it is hard-coded to the United States time zones. &amp;quot;EST&amp;quot;, &amp;quot;CST&amp;quot;, etc. all refer to the four continental US timezones. Tough luck if you live in Australia, where CST refers to Australian Central Standard Time = UTC+9:30. If you use JScript, it means US Central Standard Time so get used to it.
</description></item><item><title>RE: Eric's Blog for January 279th, 2003</title><link>http://blogs.msdn.com/ericlippert/archive/2003/10/06/53150.aspx#53152</link><pubDate>Tue, 07 Oct 2003 01:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:53152</guid><dc:creator>Eric Lippert</dc:creator><description>Yes, that is sub-optimal -- there are many locale biases in JScript, which is odd considering that it is a language designed for the WORLD WIDE web.

I don't consider the localized timezone issue to be particularly bad though, because  it is pretty easy to roll your own toString method that prints out the timezone offset as a number.
</description></item><item><title>RE: Eric's Blog for January 279th, 2003</title><link>http://blogs.msdn.com/ericlippert/archive/2003/10/06/53150.aspx#53153</link><pubDate>Tue, 07 Oct 2003 02:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:53153</guid><dc:creator>Henry Stapp</dc:creator><description>Great... the last four paragraphs are the best summary I've seen of the practical limitations of JScript and other scripting languages. Having built a large structure (tall office building perhaps, not a skyscraper - see www.youbet.com's racing rite) with JScript, I emphatically agree with what you're saying.

Cheers,

Henry Stapp</description></item><item><title>RE: Eric's Blog for January 279th, 2003</title><link>http://blogs.msdn.com/ericlippert/archive/2003/10/06/53150.aspx#53154</link><pubDate>Fri, 10 Oct 2003 04:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:53154</guid><dc:creator>Jay Hugard</dc:creator><description>On the date constructor wierdness, MDSN had a great explanation of &amp;quot;Date and Time Arithmetic in JScript&amp;quot;.  I never once realized that the Date constructor was created that way as a means of avoiding an error... seemed pretty elegant to me:

http://tinyurl.com/qe7g

aka

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvid/html/msdn_vidateadd.asp

</description></item><item><title>re: Eric's Blog for January 279th, 2003</title><link>http://blogs.msdn.com/ericlippert/archive/2003/10/06/53150.aspx#423600</link><pubDate>Wed, 01 Jun 2005 00:25:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:423600</guid><dc:creator>Mick White</dc:creator><description>Consider:&lt;br&gt;&lt;br&gt;function isLeapYear(yyyy){&lt;br&gt;return new Date(yyyy,1,29).getMonth()==1;&lt;br&gt;}&lt;br&gt;&lt;br&gt;In plain English:&lt;br&gt;Is Feb 29 in Feb? If so, it's a leap year.&lt;br&gt;&lt;br&gt;Mick</description></item><item><title>re: Eric's Blog for January 279th, 2003</title><link>http://blogs.msdn.com/ericlippert/archive/2003/10/06/53150.aspx#462116</link><pubDate>Wed, 07 Sep 2005 23:56:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:462116</guid><dc:creator>Brendan Eich</dc:creator><description>Eric wrote:&lt;br&gt;&lt;br&gt;  ``So &amp;quot;9&amp;quot;, not &amp;quot;10&amp;quot;, is October.  If you want to know why that is, ask Brendan next time you see him, 'cause I sure don't know.''&lt;br&gt;&lt;br&gt;My answer: because that's how java.util.Date did it.&lt;br&gt;&lt;br&gt;JavaScript was renamed from LiveScript in December 1995, as part of the Sun/Netscape deal that attracted so much attention (including from your employer, judging from the antitrust case findings).  The new name was mostly a marketing scam, but there was also a prior commitment, or curse, placed by management on JS to be &amp;quot;Java's little brother&amp;quot; who helped script applets, as someone else noted here.&lt;br&gt;&lt;br&gt;From mid-1995, when I created the language with the code-name &amp;quot;Mocha&amp;quot;, we really were trying not to reinvent wheels to be any more or less round than Java's equivalent, where we could justify mimicking Java.&lt;br&gt;&lt;br&gt;Unfortunately, java.util.Date had a pile of y2k and usability bugs.  Better luck next marketing scam!  Or, better luck next &amp;quot;little brother to a big, not actually related programming language&amp;quot; curse.  Next time, I won't be anywhere near the victim of such a curse.&lt;br&gt;&lt;br&gt;/be</description></item><item><title>re: Eric's Blog for January 279th, 2003</title><link>http://blogs.msdn.com/ericlippert/archive/2003/10/06/53150.aspx#462171</link><pubDate>Thu, 08 Sep 2005 01:51:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:462171</guid><dc:creator>Eric Lippert</dc:creator><description>I suspected as much.  &lt;br&gt;&lt;br&gt;Thanks Brendan!  Your commentary here is always appreciated.&lt;br&gt;</description></item><item><title>Web Development Trends for 2006</title><link>http://blogs.msdn.com/ericlippert/archive/2003/10/06/53150.aspx#462729</link><pubDate>Fri, 09 Sep 2005 05:30:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:462729</guid><dc:creator>franklinmint.fm</dc:creator><description>Anil Dash has just published, um, Web Development Trends for 2006. Agree/Disagree. Let's break it down. Dampening This is where...</description></item><item><title>Error Handling in VBScript, Part Three</title><link>http://blogs.msdn.com/ericlippert/archive/2003/10/06/53150.aspx#1326809</link><pubDate>Tue, 19 Dec 2006 20:55:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1326809</guid><dc:creator>Fabulous Adventures In Coding</dc:creator><description>&lt;p&gt;Apparently I've sparked a discussion amongst the super-geniuses of LtU on various innovative language&lt;/p&gt;
</description></item><item><title>re: Eric's Blog for January 279th, 2003</title><link>http://blogs.msdn.com/ericlippert/archive/2003/10/06/53150.aspx#2936408</link><pubDate>Mon, 28 May 2007 09:59:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2936408</guid><dc:creator>harmony7</dc:creator><description>&lt;p&gt;From my understanding, the reason Java, and struct tm (from UNIX's C) use a zero-based month is so that you can have an array -- for example,&lt;/p&gt;
&lt;p&gt;char *MONTHS = { &amp;quot;Jan&amp;quot;, &amp;quot;Feb&amp;quot;, &amp;quot;Mar&amp;quot;, ... /* etc *. };&lt;/p&gt;
&lt;p&gt;and then index into it directly because those languages use a zero-based subscript.&lt;/p&gt;
&lt;p&gt;I think the day of the week is done similarly as well.&lt;/p&gt;
</description></item><item><title>The Rarefied Heights of Mathematical Purity</title><link>http://blogs.msdn.com/ericlippert/archive/2003/10/06/53150.aspx#5403548</link><pubDate>Thu, 11 Oct 2007 21:40:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5403548</guid><dc:creator>Fabulous Adventures In Coding</dc:creator><description>&lt;p&gt;A number of people have asked me for the software I used yesterday to extract the Google queries from&lt;/p&gt;
</description></item></channel></rss>