Blesta Addons Posted April 2, 2016 Report Posted April 2, 2016 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 cron setting s & logs PauloV 1 Quote
0 evolvewh Posted April 3, 2016 Report Posted April 3, 2016 That is strange. Hopefully one of these 4.0 tasks takes care of it. https://dev.blesta.com/browse/CORE-1485 https://dev.blesta.com/browse/CORE-2149 Quote
0 Blesta Addons Posted April 3, 2016 Author Report Posted April 3, 2016 if this related to the timezone , maybe that other issue we have in suspending services , any other issue related to cron use the wrong date . waiting for blesta team to confirm , and a temporary fix as this is trivial for us . PauloV 1 Quote
0 Tyson Posted April 4, 2016 Report Posted April 4, 2016 What is the `invoices`.`date_billed` for that invoice in the database? And what is your timezone set to? v3 of Blesta stores all dates in UTC, so the issue may be that your old dates from v2 were not offset by your timezone. Michael 1 Quote
0 Blesta Addons Posted April 4, 2016 Author Report Posted April 4, 2016 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 !!!! Quote
0 Blesta Addons Posted April 4, 2016 Author Report Posted April 4, 2016 i think i have found the bug . 02-04-2015 00:00 - 1Hour = 01-04-2016 23:00 and not 02-04-2015 23:00 i think blesta is converting time from UTC to UTC(-/+)X without make in consideration the date . activa 1 Quote
0 Tyson Posted April 6, 2016 Report Posted April 6, 2016 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? Quote
0 Blesta Addons Posted April 6, 2016 Author Report Posted April 6, 2016 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 ? Quote
0 Tyson Posted April 7, 2016 Report Posted April 7, 2016 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. Quote
0 evolvewh Posted April 8, 2016 Report Posted April 8, 2016 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. Quote
Question
Blesta Addons
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
cron setting s & logs
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.