Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

workitem #6244, added format '%N' to time.strftime

  • Loading branch information...
commit c9d8339441e21a90216b9b51cffd23f5225d0174 1 parent d4a4496
@enricosada authored
View
4 Languages/Ruby/Libraries/Builtins/RubyTime.cs
@@ -939,6 +939,10 @@ public static class RubyTimeOps {
case 'M':
dateTimeFormat = "mm";
+ break;
+
+ case 'N':
+ dateTimeFormat = "fffffff00";
break;
case 'p':
View
5 Languages/Ruby/Tests/mspec/rubyspec/core/time/strftime_spec.rb
@@ -165,6 +165,11 @@
time.strftime('%M').should == '06'
end
+ it "returns the fractional seconds digits, default is 9 digits (nanosecond) with %N" do
+ time = Time.local(2009, 9, 18, 12, 0, 6, 123456)
+ time.strftime('%N').should == '123456000'
+ end
+
it "returns the second with %S" do
time = Time.local(2009, 9, 18, 12, 0, 6)
time.strftime('%S').should == '06'

0 comments on commit c9d8339

Please sign in to comment.
Something went wrong with that request. Please try again.