-
-
Save mistyrinth/bf890f087e2cd56f3f048de8c6430b06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Timeオブジェクトを配列として取得 | |
time = Time.now | |
aryTime = time.to_a | |
p aryTime | |
# 起算時からの経過秒数を取得 | |
pasttime = time.to_f | |
p pasttime | |
# タイムゾーンと協定世界時の時差を取得 | |
timedifs = time.utc_offset | |
puts "時差は#{timedifs}秒です" | |
timedifh = timedifs / 60 / 60 | |
puts "時間に直すと#{timedifh}時間です" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment