Skip to content

Instantly share code, notes, and snippets.

@DouglasAllen
Created February 15, 2012 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DouglasAllen/1837159 to your computer and use it in GitHub Desktop.
Save DouglasAllen/1837159 to your computer and use it in GitHub Desktop.
A liitle ditty to play with Julian
#!/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
@DouglasAllen
Copy link
Author

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.

@DouglasAllen
Copy link
Author

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