本文简要介绍ruby语言中 Time.subsec
的用法。
用法
subsec → number
返回 time
的亚秒级。
返回值可以是有理数。
t = Time.now #=> 2020-07-20 15:40:26.867462289 +0900
t.subsec #=> (867462289/1000000000)
t = Time.now #=> 2020-07-20 15:40:50.313828595 +0900
t.subsec #=> (62765719/200000000)
t = Time.new(2000,1,1,2,3,4) #=> 2000-01-01 02:03:04 +0900
t.subsec #=> 0
Time.new(2000,1,1,0,0,1/3r,"UTC").subsec #=> (1/3)
相关用法
- Ruby Time.sunday?用法及代码示例
- Ruby Time.sec用法及代码示例
- Ruby Time.saturday?用法及代码示例
- Ruby Time.strptime用法及代码示例
- Ruby Time.strftime用法及代码示例
- Ruby Time.gmtime用法及代码示例
- Ruby Time.at用法及代码示例
- Ruby Time.utc_offset用法及代码示例
- Ruby Time.isdst用法及代码示例
- Ruby Time.time + numeric用法及代码示例
- Ruby Time.wednesday?用法及代码示例
- Ruby Time.localtime用法及代码示例
- Ruby Time.yday用法及代码示例
- Ruby Time.time <=>用法及代码示例
- Ruby Time.month用法及代码示例
- Ruby Time.utc?用法及代码示例
- Ruby Time.new用法及代码示例
- Ruby Time.monday?用法及代码示例
- Ruby Time.getutc用法及代码示例
- Ruby Time.round用法及代码示例
- Ruby Time.dst?用法及代码示例
- Ruby Time.tv_nsec用法及代码示例
- Ruby Time.xmlschema用法及代码示例
- Ruby Time.gmt?用法及代码示例
- Ruby Time.to_r用法及代码示例
注:本文由纯净天空筛选整理自ruby-lang.org大神的英文原创作品 Time.subsec。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。