edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C447221
File: Initializers.Generated.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C447221  (server)    5/20/2008 10:45 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;ItsAboutTime
@@ -51,7 +51,7 @@
             ExtendModule(typeof(System.Collections.Generic.IDictionary<System.Object, System.Object>), new System.Action<Ruby.Builtins.RubyModule>(LoadSystem__Collections__Generic__IDictionary_Instance), null, new Ruby.Builtins.RubyModule[] {def16, });
             ExtendModule(typeof(System.Collections.IEnumerable), new System.Action<Ruby.Builtins.RubyModule>(LoadSystem__Collections__IEnumerable_Instance), null, new Ruby.Builtins.RubyModule[] {def16, });
             ExtendModule(typeof(System.Collections.IList), new System.Action<Ruby.Builtins.RubyModule>(LoadSystem__Collections__IList_Instance), null, new Ruby.Builtins.RubyModule[] {def16, });
-            ExtendModule(typeof(System.IComparable), new System.Action<Ruby.Builtins.RubyModule>(LoadSystem__IComparable_Instance), null, new Ruby.Builtins.RubyModule[] {def25, });
+            Ruby.Builtins.RubyModule def29 = ExtendModule(typeof(System.IComparable), new System.Action<Ruby.Builtins.RubyModule>(LoadSystem__IComparable_Instance), null, new Ruby.Builtins.RubyModule[] {def25, });
             DefineGlobalClass("Array", typeof(Ruby.Builtins.RubyArray), Context.ObjectClass, new System.Action<Ruby.Builtins.RubyModule>(LoadArray_Instance), new System.Action<Ruby.Builtins.RubyModule>(LoadArray_Class), new Ruby.Builtins.RubyModule[] {def16, }, new System.Delegate[] {
                 new Microsoft.Scripting.Utils.Function<Ruby.Builtins.RubyArray>(Ruby.Builtins.ArrayOps.CreateArray),
                 new Microsoft.Scripting.Utils.Function<System.Collections.IList, Ruby.Builtins.RubyArray>(Ruby.Builtins.ArrayOps.CreateArray),
@@ -62,7 +62,7 @@
                 new Microsoft.Scripting.Utils.Function<Microsoft.Scripting.Runtime.CodeContext, Ruby.Runtime.BlockParam, System.Object, System.Object>(Ruby.Builtins.ArrayOps.CreateArray),
             });
             DefineGlobalClass("Binding", typeof(Ruby.Builtins.Binding), Context.ObjectClass, null, null, Ruby.Builtins.RubyModule.EmptyArray, null);
-            DefineGlobalClass("ClrString", typeof(System.String), Context.ObjectClass, new System.Action<Ruby.Builtins.RubyModule>(LoadClrString_Instance), null, Ruby.Builtins.RubyModule.EmptyArray, null);
+            DefineGlobalClass("ClrString", typeof(System.String), Context.ObjectClass, new System.Action<Ruby.Builtins.RubyModule>(LoadClrString_Instance), null, new Ruby.Builtins.RubyModule[] {def29, }, null);
             DefineGlobalClass("Dir", typeof(Ruby.Builtins.RubyDir), Context.ObjectClass, new System.Action<Ruby.Builtins.RubyModule>(LoadDir_Instance), new System.Action<Ruby.Builtins.RubyModule>(LoadDir_Class), new Ruby.Builtins.RubyModule[] {def16, }, null);
             Ruby.Builtins.RubyClass def26 = Context.ExceptionClass = DefineGlobalClass("Exception", typeof(System.Exception), Context.ObjectClass, new System.Action<Ruby.Builtins.RubyModule>(LoadException_Instance), new System.Action<Ruby.Builtins.RubyModule>(LoadException_Class), Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] {
                 new Microsoft.Scripting.Utils.Function<Ruby.Builtins.MutableString, System.Exception>(Ruby.Builtins.ExceptionOps.Factory),
@@ -4697,6 +4697,11 @@
                 new Microsoft.Scripting.Utils.Function<System.DateTime, System.Int32>(Ruby.Builtins.TimeOps.Second),
             });
             
+            module.DefineLibraryMethod("strftime", 0x29, new System.Delegate[] {
+                new Microsoft.Scripting.Utils.Function<System.DateTime, Ruby.Builtins.MutableString, Ruby.Builtins.MutableString>(Ruby.Builtins.TimeOps.FormatTime),
+                new Microsoft.Scripting.Utils.Function<Microsoft.Scripting.Runtime.CodeContext, System.DateTime, System.Object, Ruby.Builtins.MutableString>(Ruby.Builtins.TimeOps.FormatTime),
+            });
+            
             module.DefineLibraryMethod("succ", 0x29, new System.Delegate[] {
                 new Microsoft.Scripting.Utils.Function<System.DateTime, System.DateTime>(Ruby.Builtins.TimeOps.SuccessiveSecond),
             });
@@ -4758,24 +4763,30 @@
                 new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateGmtTime),
                 new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateGmtTime),
                 new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateGmtTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateGmtTime),
+                new Microsoft.Scripting.Utils.Function<Microsoft.Scripting.Runtime.CodeContext, System.Object, System.Object[], System.DateTime>(Ruby.Builtins.TimeOps.CreateGmtTime),
             });
             
             module.DefineLibraryMethod("local", 0x31, new System.Delegate[] {
-                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.createLocalTime),
-                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.createLocalTime),
-                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.createLocalTime),
-                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.createLocalTime),
-                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.createLocalTime),
-                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.createLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<Microsoft.Scripting.Runtime.CodeContext, System.Object, System.Object[], System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
             });
             
             module.DefineLibraryMethod("mktime", 0x31, new System.Delegate[] {
-                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.createLocalTime),
-                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.createLocalTime),
-                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.createLocalTime),
-                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.createLocalTime),
-                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.createLocalTime),
-                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.createLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
+                new Microsoft.Scripting.Utils.Function<Microsoft.Scripting.Runtime.CodeContext, System.Object, System.Object[], System.DateTime>(Ruby.Builtins.TimeOps.CreateLocalTime),
             });
             
             module.DefineLibraryMethod("now", 0x31, new System.Delegate[] {
@@ -4793,6 +4804,8 @@
                 new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateGmtTime),
                 new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateGmtTime),
                 new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateGmtTime),
+                new Microsoft.Scripting.Utils.Function<System.Object, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.DateTime>(Ruby.Builtins.TimeOps.CreateGmtTime),
+                new Microsoft.Scripting.Utils.Function<Microsoft.Scripting.Runtime.CodeContext, System.Object, System.Object[], System.DateTime>(Ruby.Builtins.TimeOps.CreateGmtTime),
             });
             
         }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs;C447029
File: TimeOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs;C447029  (server)    5/21/2008 4:47 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs;ItsAboutTime
@@ -14,12 +14,13 @@
  * ***************************************************************************/
 
 using System;
+using System.Globalization;
+using System.Text;
 
 using Microsoft.Scripting.Math;
+using Microsoft.Scripting.Runtime;
 
 using Ruby.Runtime;
-using Microsoft.Scripting.Runtime;
-using System.Globalization;
 
 namespace Ruby.Builtins {
 
@@ -120,40 +121,64 @@
 
         [RubyMethod("local", RubyMethodAttributes.PublicSingleton)]
         [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)]
-        public static DateTime createLocalTime(object/*!*/ self, int Year) {
-            return new DateTime(Year, 1, 1);
+        public static DateTime CreateLocalTime(object/*!*/ self, int year) {
+            return new DateTime(year, 1, 1);
         }
 
         [RubyMethod("local", RubyMethodAttributes.PublicSingleton)]
         [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)]
-        public static DateTime createLocalTime(object/*!*/ self, int Year, int Month) {
-            return new DateTime(Year, Month, 1);
+        public static DateTime CreateLocalTime(object/*!*/ self, int year, int month) {
+            return new DateTime(year, month, 1);
         }
 
         [RubyMethod("local", RubyMethodAttributes.PublicSingleton)]
         [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)]
-        public static DateTime createLocalTime(object/*!*/ self, int Year, int Month, int Day) {
-            return new DateTime(Year, Month, Day);
+        public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day) {
+            return new DateTime(year, month, day);
         }
 
         [RubyMethod("local", RubyMethodAttributes.PublicSingleton)]
         [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)]
-        public static DateTime createLocalTime(object/*!*/ self, int Year, int Month, int Day, int Hour) {
-            return new DateTime(Year, Month, Day, 0, 0, 0);
+        public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day, int hour) {
+            return new DateTime(year, month, day, hour, 0, 0);
         }
 
         [RubyMethod("local", RubyMethodAttributes.PublicSingleton)]
         [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)]
-        public static DateTime createLocalTime(object/*!*/ self, int Year, int Month, int Day, int Hour, int Minute) {
-            return new DateTime(Year, Month, Day, Hour, Minute, 0);
+        public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day, int hour, int minute) {
+            return new DateTime(year, month, day, hour, minute, 0);
         }
 
         [RubyMethod("local", RubyMethodAttributes.PublicSingleton)]
         [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)]
-        public static DateTime createLocalTime(object/*!*/ self, int Year, int Month, int Day, int Hour, int Minute, int Second) {
-            return new DateTime(Year, Month, Day, Hour, Minute, Second);
+        public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second) {
+            return new DateTime(year, month, day, hour, minute, second);
         }
 
+        [RubyMethod("local", RubyMethodAttributes.PublicSingleton)]
+        [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)]
+        public static DateTime CreateLocalTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second, int millisecond) {
+            return new DateTime(year, month, day, hour, minute, second, millisecond);
+        }
+
+        private static int GetComponent(CodeContext/*!*/ context, object[] components, int index, int defValue) {
+            if (index >= components.Length || components[index] == null) {
+                return defValue;
+            }
+            return Protocols.CastToFixnum(context, components[index]);
+        }
+
+        [RubyMethod("local", RubyMethodAttributes.PublicSingleton)]
+        [RubyMethod("mktime", RubyMethodAttributes.PublicSingleton)]
+        public static DateTime CreateLocalTime(CodeContext/*!*/ context, object/*!*/ self, [NotNull]params object[]/*!*/ components) {
+            if (components.Length > 7 || components.Length == 0) {
+                throw RubyExceptions.CreateArgumentError(String.Format("wrong number of arguments ({0} for 7)", components.Length));
+            }
+            return new DateTime(Protocols.CastToFixnum(context, components[0]), GetComponent(context, components, 1, 1),
+                GetComponent(context, components, 2, 1), GetComponent(context, components, 3, 0), GetComponent(context, components, 4, 0),
+                GetComponent(context, components, 5, 0), GetComponent(context, components, 6, 0));
+        }
+
         #endregion
 
         //--------------------------------------------------------------- Time::gm
@@ -179,40 +204,57 @@
 
         [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)]
         [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)]
-        public static DateTime CreateGmtTime(object/*!*/ self, int Year) {
-            return new DateTime(Year, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+        public static DateTime CreateGmtTime(object/*!*/ self, int year) {
+            return new DateTime(year, 1, 1, 0, 0, 0, DateTimeKind.Utc);
         }
 
         [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)]
         [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)]
-        public static DateTime CreateGmtTime(object/*!*/ self, int Year, int Month) {
-            return new DateTime(Year, Month, 1, 0, 0, 0, DateTimeKind.Utc);
+        public static DateTime CreateGmtTime(object/*!*/ self, int year, int month) {
+            return new DateTime(year, month, 1, 0, 0, 0, DateTimeKind.Utc);
         }
 
         [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)]
         [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)]
-        public static DateTime CreateGmtTime(object/*!*/ self, int Year, int Month, int Day) {
-            return new DateTime(Year, Month, Day, 0, 0, 0, DateTimeKind.Utc);
+        public static DateTime CreateGmtTime(object/*!*/ self, int year, int month, int day) {
+            return new DateTime(year, month, day, 0, 0, 0, DateTimeKind.Utc);
         }
 
         [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)]
         [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)]
-        public static DateTime CreateGmtTime(object/*!*/ self, int Year, int Month, int Day, int Hour) {
-            return new DateTime(Year, Month, Day, 0, 0, 0);
+        public static DateTime CreateGmtTime(object/*!*/ self, int year, int month, int day, int hour) {
+            return new DateTime(year, month, day, hour, 0, 0, DateTimeKind.Utc);
         }
 
         [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)]
         [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)]
-        public static DateTime CreateGmtTime(object/*!*/ self, int Year, int Month, int Day, int Hour, int Minute) {
-            return new DateTime(Year, Month, Day, Hour, Minute, 0);
+        public static DateTime CreateGmtTime(object/*!*/ self, int year, int month, int day, int hour, int minute) {
+            return new DateTime(year, month, day, hour, minute, 0, DateTimeKind.Utc);
         }
 
         [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)]
         [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)]
-        public static DateTime CreateGmtTime(object/*!*/ self, int Year, int Month, int Day, int Hour, int Minute, int Second) {
-            return new DateTime(Year, Month, Day, Hour, Minute, Second);
+        public static DateTime CreateGmtTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second) {
+            return new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc);
         }
 
+        [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)]
+        [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)]
+        public static DateTime CreateGmtTime(object/*!*/ self, int year, int month, int day, int hour, int minute, int second, int millisecond) {
+            return new DateTime(year, month, day, hour, minute, second, millisecond, DateTimeKind.Utc);
+        }
+
+        [RubyMethod("utc", RubyMethodAttributes.PublicSingleton)]
+        [RubyMethod("gm", RubyMethodAttributes.PublicSingleton)]
+        public static DateTime CreateGmtTime(CodeContext/*!*/ context, object/*!*/ self, [NotNull]params object[]/*!*/ components) {
+            if (components.Length > 7 || components.Length == 0) {
+                throw RubyExceptions.CreateArgumentError(String.Format("wrong number of arguments ({0} for 7)", components.Length));
+            }
+            return new DateTime(Protocols.CastToFixnum(context, components[0]), GetComponent(context, components, 1, 1),
+                GetComponent(context, components, 2, 1), GetComponent(context, components, 3, 0), GetComponent(context, components, 4, 0),
+                GetComponent(context, components, 5, 0), GetComponent(context, components, 6, 0), DateTimeKind.Utc);
+        }
+
         #endregion
 
         #endregion "Singleton Methods"
@@ -452,6 +494,110 @@
             return self.DayOfYear;
         }
 
+        [RubyMethod("strftime")]
+        public static MutableString/*!*/ FormatTime(DateTime self, [NotNull]MutableString/*!*/ format) {
+            bool inEscape = false;
+            StringBuilder builder = new StringBuilder();
+            foreach (char c in format.ToString()) {
+                if (c == '%' && !inEscape) {
+                    inEscape = true;
+                    continue;
+                }
+                if (inEscape) {
+                    string thisFormat = null;
+                    DateTime firstDay;
+                    int week;
+                    switch (c) {
+                        case 'a':
+                            thisFormat = "ddd";
+                            break;
+                        case 'A':
+                            thisFormat = "dddd";
+                            break;
+                        case 'b':
+                            thisFormat = "MMM";
+                            break;
+                        case 'B':
+                            thisFormat = "MMMM";
+                            break;
+                        case 'c':
+                            thisFormat = "g";
+                            break;
+                        case 'd':
+                            thisFormat = "dd";
+                            break;
+                        case 'H':
+                            thisFormat = "HH";
+                            break;
+                        case 'I':
+                            thisFormat = "hh";
+                            break;
+                        case 'j':
+                            builder.AppendFormat("{0:000}", self.DayOfYear);
+                            break;
+                        case 'm':
+                            thisFormat = "MM";
+                            break;
+                        case 'M':
+                            thisFormat = "mm";
+                            break;
+                        case 'p':
+                            thisFormat = "tt";
+                            break;
+                        case 'S':
+                            thisFormat = "ss";
+                            break;
+                        case 'U':
+                            firstDay = self.AddDays(1 - self.DayOfYear);
+                            DateTime firstSunday = firstDay.AddDays((7 - (int)firstDay.DayOfWeek) % 7);
+                            week = 1 + (int)Math.Floor((self - firstSunday).Days / 7.0);
+                            builder.AppendFormat("{0:00}", week);
+                            break;
+                        case 'W':
+                            firstDay = self.AddDays(1 - self.DayOfYear);
+                            DateTime firstMonday = firstDay.AddDays((8 - (int)firstDay.DayOfWeek) % 7);
+                            week = 1 + (int)Math.Floor((self - firstMonday).Days / 7.0);
+                            builder.AppendFormat("{0:00}", week);
+                            break;
+                        case 'w':
+                            builder.Append((int)self.DayOfWeek);
+                            break;
+                        case 'x':
+                            thisFormat = "d";
+                            break;
+                        case 'X':
+                            thisFormat = "t";
+                            break;
+                        case 'y':
+                            thisFormat = "yy";
+                            break;
+                        case 'Y':
+                            thisFormat = "yyyy";
+                            break;
+                        case 'Z':
+                            thisFormat = "%K";
+                            break;
+                        default:
+                            builder.Append(c);
+                            break;
+                    }
+                    if (thisFormat != null) {
+                        builder.Append(self.ToString(thisFormat));
+                    }
+                    inEscape = false;
+                } else {
+                    builder.Append(c);
+                }
+            }
+
+            return MutableString.Create(builder.ToString());
+        }
+
+        [RubyMethod("strftime")]
+        public static MutableString/*!*/ FormatTime(CodeContext/*!*/ context, DateTime self, object format) {
+            return FormatTime(self, Protocols.CastToString(context, format));
+        }
+
         //-------------------------------------------------------------- Time#succ
         //     time.succ   => new_time
         //------------------------------------------------------------------------
===================================================================
delete: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/tags/ruby/1.8/core/time/strftime_spec.rb.txt;C443647
File: strftime_spec.rb.txt
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/tags/ruby/1.8/core/time/strftime_spec.rb.txt;C443647  (server)    5/22/2008 8:59 PM
+++ [no target file]
@@ -1,2 +1,0 @@
-fails():Time#strftime formats time according to the directives in the given format string
-fails():Time#strftime supports week of year format with %U and %W
===================================================================
