Created
February 15, 2012 16:35
-
-
Save DouglasAllen/1837159 to your computer and use it in GitHub Desktop.
A liitle ditty to play with Julian
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
#!/usr/local/rvm/rubies/ruby-1.9.3-p125/bin/ruby | |
# a trick to block late entries. | |
require 'date' | |
time = Time.now.utc | |
theDate = Date.new(time.year, time.month, time.day) | |
=begin | |
=end # just put a blank space first and everything else is commented out. | |
puts time | |
puts theDate | |
puts theDate.ajd | |
puts theDate.jd - 0.5 | |
puts theDate.jd | |
theDayFraction = time.hour/24.0 + time.min/1440.0 + time.sec/86400.0 | |
puts theDayFraction | |
theTotal = theDate.ajd + theDayFraction | |
puts theTotal |
Expected output: Dates and times will vary.
Wed Feb 15 16:33:24 UTC 2012
2012-02-15
4911945/2
2455972.5
2455973
0.689861111111111
2455973.18986111
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Okay then, let's call it "Play with Joseph Scaliger".
netbeans does not approve of my camel casing. But the the spell checker doesn't approve of netbeans
either. Oh well.