Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Incorrect Julian Day

Incorrect Julian Day

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pswin
    wrote on last edited by
    #1

    The following code produces wrong Julian day:

    qDebug() << QDate( 622, 7, 16 ) ;
    

    I would expect the results to be:
    1948440 or 1948439.5

    Instead i get:
    1948437

    you can check the correct Julian date from following websites:

    http://numerical.recipes/julian.html
    http://aa.usno.navy.mil/data/docs/JulianDate.php

    Is it a bug? and should I report it?

    kshegunovK 1 Reply Last reply
    0
    • P Pswin

      The following code produces wrong Julian day:

      qDebug() << QDate( 622, 7, 16 ) ;
      

      I would expect the results to be:
      1948440 or 1948439.5

      Instead i get:
      1948437

      you can check the correct Julian date from following websites:

      http://numerical.recipes/julian.html
      http://aa.usno.navy.mil/data/docs/JulianDate.php

      Is it a bug? and should I report it?

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @Pswin
      Why do you assume you should get a Julian calendar date? The class may use that internally, but still the most widely used calendar nowadays is the Gregorian ... also there's this: QDate::toJulianDay

      Read and abide by the Qt Code of Conduct

      P 1 Reply Last reply
      0
      • miclandM Offline
        miclandM Offline
        micland
        wrote on last edited by
        #3

        Your using the gregorian calender as input, not the julian calender.
        There is a gap of three days (see http://www.wolframalpha.com/input/?i=julian+date+622-7-16)

        1 Reply Last reply
        2
        • kshegunovK kshegunov

          @Pswin
          Why do you assume you should get a Julian calendar date? The class may use that internally, but still the most widely used calendar nowadays is the Gregorian ... also there's this: QDate::toJulianDay

          P Offline
          P Offline
          Pswin
          wrote on last edited by
          #4

          @kshegunov
          I am using it for converting between different calendars. actually I am writing an open source library for Qt which supports some calendars such as Persian and Hijri.

          @micland
          Thank you.

          kshegunovK 1 Reply Last reply
          0
          • P Pswin

            @kshegunov
            I am using it for converting between different calendars. actually I am writing an open source library for Qt which supports some calendars such as Persian and Hijri.

            @micland
            Thank you.

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #5

            @Pswin
            My point was that whatsoever the internal representation is the API still uses Gregorian calendar (which @micland stated explicitly).

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved