summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authorzverok <zverok.offline@gmail.com>2019-12-21 22:37:35 +0200
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-22 23:17:39 +0900
commit4988843188c7a1666b11e1390acd7b991941c3a8 (patch)
tree66cc524b051ff75efcb162a7e152b058f6436787 /time.c
parent5fa9c2eeb04a2e44a2a028d933bc95f219a6a282 (diff)
Actualize Time#inspect docs
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2768
Diffstat (limited to 'time.c')
-rw-r--r--time.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/time.c b/time.c
index 1016537501..8c5422df0b 100644
--- a/time.c
+++ b/time.c
@@ -4091,14 +4091,15 @@ time_to_s(VALUE time)
* call-seq:
* time.inspect -> string
*
- * Returns a detailed string representing _time_.
+ * Returns a detailed string representing _time_. Inlike to_s, preserves
+ * nanoseconds in representation for easier debugging.
*
* t = Time.now
- * t.to_s #=> "2012-11-10 18:16:12 +0100"
- * t.strftime "%Y-%m-%d %H:%M:%S %z" #=> "2012-11-10 18:16:12 +0100"
+ * t.inspect #=> "2012-11-10 18:16:12.261257655 +0100"
+ * t.strftime "%Y-%m-%d %H:%M:%S.%N %z" #=> "2012-11-10 18:16:12.261257655 +0100"
*
- * t.utc.to_s #=> "2012-11-10 17:16:12 UTC"
- * t.strftime "%Y-%m-%d %H:%M:%S UTC" #=> "2012-11-10 17:16:12 UTC"
+ * t.utc.inspect #=> "2012-11-10 17:16:12.261257655 UTC"
+ * t.strftime "%Y-%m-%d %H:%M:%S.%N UTC" #=> "2012-11-10 17:16:12.261257655 UTC"
*/
static VALUE