Julian date help

andyshrimpton

New Member
Hello all.

I have been trying the julian date code found in the code snippets section but do not understand what is going on. Link at botton of this post

UPDATE The code at the bottom of the page work fine it was user error entering the figures

I am trying to calculate the number of days between to dates for example from 1/1/2012 to 1/7/2014 which in excel is 912 days which allows for a leap year. The julian numbers are 2455928 and 2456840= 912 differance

http://www.nr.com/julian.html


There are many codes that can be used found on google but they use large numbers (7 figures during calculation)

Has anybody done this before and willing to share the code or explain how the code here works

http://www.picaxeforum.co.uk/showthread.php?t=8674


Regards
 
Last edited:

premelec

Senior Member
I have a text from 2008-01-29 posted by tikeda "Julian Code for PICAXE" try a search on that - it looks like whta you may need... OK I finally got that link to load and it looks like you are already there - probably need some deep study of his methods and sources - can't say I understand it! :)
 
Last edited:

westaust55

Moderator
@andyshrimpton,

the reason that many other examples use 7 digits is that the start (aka epoch date) is often something like 1 Jan 1970 or earlier.

PICAXE basic can hold values up to 60,5535 in a word variable and thus can handle a range of around 178 years. That is why tikeda used an epoch (start) date of 1 Jan 2000.

I have done something similar (in my 1-Wire tutorial and program thread) but working in seconds as used by some 1-wire clock devices.
Using two word variables I can store numbers up to 4,294,967,295 but when working in seconds and a start/epoch date of 1 Jan 1970 even that overflows in about another 70 years.
 
Last edited:

andyshrimpton

New Member
Thanks Westaust55
Sound information as always thanks for your input.

I will have a look at your 1 wire example but i think it will be way to advance for me

:)
 
Top