Results 1 to 7 of 7

Thread: JD to UTC

  1. #1
    Join Date
    Sep 2006
    Location
    I live in Massachusettes; Observatory in New Mexico
    Posts
    448

    Default JD to UTC

    Anyone have an Excel formula to convert JD to UTC date and time?

    ..geo

  2. #2
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    5,990

    Default

    George, I think I have something you can use - I just can't get to it from where I am at work. I'll reply again later today.
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XMEv
    H-alpha, BVRI, RGB & Clear filters
    FOV ~15’ x 10’



  3. #3
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    5,990

    Default

    Hi George,

    Sorry, what I was thinking of turned out to be a routine I use for correcting geocentric times of minima to heliocentric times, not converting JD to UTC. I had built a function to do this and put in inside a code module to make it available.

    If you can link to ACP, there are several Util. methods that do this conversions, but that probably doesn't help.

    USNO has an online converter at http://aa.usno.navy.mil/data/docs/JulianDate.php, but that probably doesn't help either.

    Here's a website that may work for you: http://www.csgnetwork.com/julianmodifdateconv.html
    If you view the source of this page, or the source of the "TJD" page it points to, the javascript is visible in the page and reusable. I'm not sure you can actually get to a one-line expression for the conversion that you can use, but you ought to be able to use the code (converted to VBScript) to script a function you can embed in a spreadsheet module and then call the function for any cell's JD.
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XMEv
    H-alpha, BVRI, RGB & Clear filters
    FOV ~15’ x 10’



  4. #4
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,216

    Default

    George, you can use ACP's served objects from Excel. Alt-F11 to get to the VBA workspace. Create a new function

    Code:
    Function JD_UTC(JD as Double) As Date
        Dim Util
        Set Util = CreateObject("ACP.Util")
        ' Nonsense below converts returned local Date to UTC via offset in hours
        JD_UTC = CDate(CDbl(Util.Julian_Date())  + (Util.SysUTCOffset / 24.0))  ' Yes plus not minus, see ACP docs on SysUTCOffset
    End Function
    I think this is the right way to apply an hours offset to VB Date objects (which are fractional days). Now use this new function in your formula(s). If you're going to use it a lot, create the Util in the function that gets called when the spreadsheet is opened and save it globally (Set Util = CreateObject("ACP.Util") at startup, etc. Then the above function would just be the last line.
    -- Bob

  5. #5
    Join Date
    Sep 2006
    Location
    I live in Massachusettes; Observatory in New Mexico
    Posts
    448

    Default

    Thanks Bob and Dick. I found exactly what I was looking for at the Variable Star South webpage Info and Resources page. Two very useful and well done spreadsheets.
    http://www.variablestarssouth.org/in...-a-calculators

    ..george

  6. #6
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    5,990

    Default

    George,
    Wow, the converter - 6th item on the list at your reference website - is astonishingly innovative and simple - just a matter of the formatting of the cells. Nothing more. No fancy calculations there.
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XMEv
    H-alpha, BVRI, RGB & Clear filters
    FOV ~15’ x 10’



  7. #7
    Join Date
    Sep 2006
    Location
    I live in Massachusettes; Observatory in New Mexico
    Posts
    448

    Default JD to UTC

    Yeah! I get to "Rococo" in my approach to such things. Then you see that and say, "Well, of course!"

 

 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •