Julian date

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
AEmpeno
Veteran Member
Posts: 72
Joined: 2018-01-04 18:48

Julian date

Post by AEmpeno » 2021-10-17 04:07

Hello,
I have a date field and I created a Julian date field. I would like to convert the date field into Julian date field as Julian date format. Is that possible? Has anyone tried it before? Thanks!

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 1357
Joined: 2018-04-01 10:12

Re: Julian date

Post by pböttcher » 2021-10-17 08:19

Hi,

maybe you can try to get the julian date from your date field MYDATE (example) with

TO_DAYS(MYDATE)+1721060

AEmpeno
Veteran Member
Posts: 72
Joined: 2018-01-04 18:48

Re: Julian date

Post by AEmpeno » 2021-10-18 03:23

Thanks for your reply, pböttcher. Here is what I'm getting.

2459505 = 10/17/2021 (date)

SELECT TO_DAYS(date)+1721060
FROM `brine_lot`
WHERE `brine_lot`.`id`='%ID%'

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 1357
Joined: 2018-04-01 10:12

Re: Julian date

Post by pböttcher » 2021-10-18 18:27

Hi,

which is correct, or what would you expect?

AEmpeno
Veteran Member
Posts: 72
Joined: 2018-01-04 18:48

Re: Julian date

Post by AEmpeno » 2021-10-18 18:58

Yes, I'm expecting as 21290 as the answer:

10/17/2021 = 21290 (21-Year, 290-10/17)

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 1357
Joined: 2018-04-01 10:12

Re: Julian date

Post by pböttcher » 2021-10-21 15:06

Hi,

good to know what type you are looking for.

Try

Code: Select all

SELECT (YEAR(date)-2000)*1000 + DAYOFYEAR(date)
FROM `brine_lot`
WHERE `brine_lot`.`id`='%ID%'

AEmpeno
Veteran Member
Posts: 72
Joined: 2018-01-04 18:48

Re: Julian date

Post by AEmpeno » 2021-11-10 17:39

Thanks, pböttcher! It worked!

Post Reply