Jump to content
  • 0

How Date Are Working In Blesta !


Blesta Addons

Question

really i can't understand how blesta use date in the system . as we have a different result from v2 and v3 .

 

service date renew is 09-04 . Invoice Days Before Renewal: 7 days both in v2 & v3 .

 

v2 date billed 2-4

v3 date billed 3-4

 

if i told to my son what is 9 - 7 , he will answer 2 .

 

screenshoot

 

798865dates.png

cron setting s & logs

 

696032cronv3.png

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

just to note , this invoice is new generated in v3 and not imported (i have run cron manually in v2 just to check the result) . also all he imported invoice is showing a correct date !!!

 

for this invoice .

 

date billied in database : 2016-04-02 23:00:12

date due in database : 2016-04-09 00:00:00

 

Timezone : UTC+1

 

tested also with

 

Timezone : UTC+1 DST

 

when i set timezone to UTC+00:00 is show a correct time !!!!

Link to comment
Share on other sites

  • 0

just to note , this invoice is new generated in v3 and not imported (i have run cron manually in v2 just to check the result) . also all he imported invoice is showing a correct date !!!

 

for this invoice .

 

date billied in database : 2016-04-02 23:00:12

date due in database : 2016-04-09 00:00:00

 

Timezone : UTC+1

 

What are the service dates for the service related to that invoice: date added, date renews, date last renewed?

 

Your bill date looks correct because the cron ran at midnight on April 3, which indeed matches 2016-04-02 23:00:12 UTC+1.

 

If Blesta retrieved all services to renew 7 days from the cron run time (2016-04-02 23:00:12 UTC+1), it would fetch all services whose renew date is on or before 2016-04-09 22:59:59 UTC+1.

 

Since the invoice due date is set to the service renew date upon creation, the service renew date must be 2016-04-09 00:00:00 UTC+1. I suspect that this service should have been renewed a day earlier, but was not for some reason. Was the cron run the day before for this task?

Link to comment
Share on other sites

  • 0

dates from database .

date added 2015-04-09 00:00:00  
date renews 2017-04-09 00:00:00  
date last renew 2016-04-09 00:00:00

so the problem here is the cron time ? normally this services should be fetched from the cron that has been run 2-4-2016 and not 3-4-2016 !

 

from your opinion what is the best time to run this cron ?

Link to comment
Share on other sites

  • 0

dates from database .

date added 2015-04-09 00:00:00  
date renews 2017-04-09 00:00:00  
date last renew 2016-04-09 00:00:00

so the problem here is the cron time ? normally this services should be fetched from the cron that has been run 2-4-2016 and not 3-4-2016 !

 

from your opinion what is the best time to run this cron ?

 

I'm not sure changing the cron time will have much of an effect because of the stored datetime stamps. Since you're UTC+1, you can try running cron tasks at midnight UTC or later, i.e. "01:00:00" UTC+1.

 

Since the dates are stored in the database with the time "00:00:00", and your timezone is UTC+1, those datetime stamps represent the day before, at UTC time 23:00:00. I think this is the issue because the service falls on a different calendar day UTC (off by an hour). It's also why changing your timezone in Blesta to UTC causes the dates to be consistent.

Link to comment
Share on other sites

  • 0

I think this is along the same lines and maybe it's addressed in one of the other core tasks for 4.0 but I wanted to add the following:

 

Since DST, my invoice generation and auto debit are running an hour later than what they're set to. I have the server time synced and invoice generation is set to run at 7am and auto debit at 9am. Right now, they run at 8am and 10am. The other tasks could be off as well but I haven't paid close attention to them.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...