mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9dd3af9ae7
commit
6c7edcb00a
1 changed files with 15 additions and 0 deletions
15
time.c
15
time.c
|
@ -3435,6 +3435,21 @@ rb_time_succ(VALUE time)
|
|||
*
|
||||
* require 'time'
|
||||
*
|
||||
* t = Time.utc(2010,3,30, 5,43,"25.123456789".to_r)
|
||||
* p t.iso8601(10) #=> "2010-03-30T05:43:25.1234567890Z"
|
||||
* p t.round.iso8601(10) #=> "2010-03-30T05:43:25.0000000000Z"
|
||||
* p t.round(0).iso8601(10) #=> "2010-03-30T05:43:25.0000000000Z"
|
||||
* p t.round(1).iso8601(10) #=> "2010-03-30T05:43:25.1000000000Z"
|
||||
* p t.round(2).iso8601(10) #=> "2010-03-30T05:43:25.1200000000Z"
|
||||
* p t.round(3).iso8601(10) #=> "2010-03-30T05:43:25.1230000000Z"
|
||||
* p t.round(4).iso8601(10) #=> "2010-03-30T05:43:25.1235000000Z"
|
||||
* p t.round(5).iso8601(10) #=> "2010-03-30T05:43:25.1234600000Z"
|
||||
* p t.round(6).iso8601(10) #=> "2010-03-30T05:43:25.1234570000Z"
|
||||
* p t.round(7).iso8601(10) #=> "2010-03-30T05:43:25.1234568000Z"
|
||||
* p t.round(8).iso8601(10) #=> "2010-03-30T05:43:25.1234567900Z"
|
||||
* p t.round(9).iso8601(10) #=> "2010-03-30T05:43:25.1234567890Z"
|
||||
* p t.round(10).iso8601(10) #=> "2010-03-30T05:43:25.1234567890Z"
|
||||
*
|
||||
* t = Time.utc(1999,12,31, 23,59,59)
|
||||
* p((t + 0.4).round.iso8601(3)) #=> "1999-12-31T23:59:59.000Z"
|
||||
* p((t + 0.49).round.iso8601(3)) #=> "1999-12-31T23:59:59.000Z"
|
||||
|
|
Loading…
Add table
Reference in a new issue