PDA

View Full Version : JulianDate



NewsArchive
01-14-2013, 05:35 AM
If I have a date - 20121001 -

I now count 60 days and to compare this with a different date - how do I
do this best?

Dirk Büchel

NewsArchive
01-14-2013, 05:35 AM
Dirk,

Just calculate the Julian Date for 20121001 and then the Julian Date for the
current date. If it is >= 60 then "do whatever you have to do".

For example:

Julian Date for January 01, 2013 = 2456294

Julian Date for January 14, 2013 = 2456307

2456307 - 2456294 = 13 (days)

Friedrich

NewsArchive
01-15-2013, 02:12 AM
Friedrich,

is there a JulianDate-Function Clarion?

I have looked for it many times, but never found it.

In an old dBase-book I have such a JD-function in source..... but can't find
that book neither!

tia
Wolfgang

NewsArchive
01-15-2013, 02:13 AM
Wolfgang,

> is there a JulianDate-Function Clarion?
>
> I have looked for it many times, but never found it.
>
> In an old dBase-book I have such a JD-function in source..... but can't
> find
> that book neither!

No, there isn't a built-in Julian Date function available in Clarion. The
Clarion Standard Date is only the number of days that have elapsed since
December 28, 1800. The Julian Date is calculated from the year 4713 BC and
increments every day since then.

Friedrich

NewsArchive
01-15-2013, 02:14 AM
Hi Dirk,

FirstDate long
Comparedate long
code
FirstDate = date( 10, 1, 2012 ) ! Guessing date is in yyyymmdd format
CompareDate = firstDate + 60
if DifferentDate > CompareDate
do StuffIfDateIsLaterThan60Days
else
do StuffIfDateIsLessThan60Days
end

Gregory Bailey

NewsArchive
01-15-2013, 02:15 AM
Gregory,

> FirstDate long
> Comparedate long
> code
> FirstDate = date( 10, 1, 2012 ) ! Guessing date is in yyyymmdd format
> CompareDate = firstDate + 60
> if DifferentDate > CompareDate
> do StuffIfDateIsLaterThan60Days
> else
> do StuffIfDateIsLessThan60Days
> end

That is Clarion code, but Dirk would like to do it in SetupScript :-)
SetupBuilder supports the "Julian Date" function to calculate the difference
between two dates.

Similar to the attached one.

Friedrich

NewsArchive
01-15-2013, 02:18 AM
> The Julian Date is calculated from the year 4713 BC

BC - that's "Before Clarion" - right<g>?

:-)

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds
www.clarionproseries.com - ProScan, ProImage, ProPath and other Clarion
developer tools!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.pagesnip.com - "Print and Save the Web, just the way you want it!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
01-15-2013, 03:58 AM
>> The Julian Date is calculated from the year 4713 BC
>
> BC - that's "Before Clarion" - right<g>?

Hehehehe :-)

Friedrich

NewsArchive
01-15-2013, 05:52 AM
work perfect - thanks :)

Dirk Büchel

NewsArchive
01-17-2013, 07:31 AM
>Wolfgang,
>
>> is there a JulianDate-Function Clarion?

>No, there isn't a built-in Julian Date function available in Clarion.

No wonder that I did not find it.....

> The
>Clarion Standard Date is only the number of days that have elapsed since
>December 28, 1800. The Julian Date is calculated from the year 4713 BC and
>increments every day since then.

With the Julian Date you can not only calculate the difference between days,
but also between hours and minutes.

The INT( JulianDate ) returns the day, but the fraction of 2456789.123456789
represents the time.

I do a lot of scheduling calculation, often over midnight. There is a series of
articles about Stardate by Doc parker on Clarion Magazine, but I "have not got
warm with that" - whatever that may have been written in correct english.

Perhaps I need to delve for that dBase II book again.

Wolfgang Orth

NewsArchive
01-18-2013, 05:34 AM
some homepages can do this:

http://www.onlineconversion.com/julian_date.htm

http://aa.usno.navy.mil/data/docs/JulianDate.php

is it not possible to implement this function in the next setupbuilder
version ?

Dirk Büchel

NewsArchive
01-18-2013, 05:49 AM
We have added an algorithm which is based on the Fliegel/van Flandern paper.
This lets you convert a Julian Date to a Gregorian day in form of a yyyymmdd
date string.

Friedrich

NewsArchive
01-18-2013, 06:54 AM
WOW !

YOUR COMPANY HAVE THE BEST SUPPORT WORLDWIDE !!!!!!!!!!!!!!!!!

Dirk Büchel

NewsArchive
01-18-2013, 06:54 AM
Added.

---
IMPROVEMENT: [SB#3-01181] Add "Gregorian Day" option to the "Handle String
Operation..." script function. It returns a date string
(yyyymmdd) from Source String that has been converted from
Julian Day.
---

Friedrich

NewsArchive
01-19-2013, 02:58 AM
> WOW !
>
> YOUR COMPANY HAVE THE BEST SUPPORT WORLDWIDE !!!!!!!!!!!!!!!!!

Thank you, Dirk :-)

Friedrich