Jump to content

Question

Posted

I have just migrated from v2.5 to v3.1 and created an invoice today with the billing and due dates both 18 February -- however when I view a PDF copy of the invoice the dates show as 17 February.  Presumably, this is a timezone conversion problem.  

 

I am located in Australia EDT (currently +11) and the server has UTC time.  When I check the timestamp in the database, it shows as "2014-02-17 13:00:00" which would suggest that 11 hours are being taken off the server time, which is incorrect as the server is already in UTC.

5 answers to this question

Recommended Posts

  • 0
Posted

Settings > Company > General: Timezone.

 

Ensure your timezone is set properly here. All dates & times are stored in the database as UTC, and displayed in the timezone selected.

  • 0
Posted

The company timezone is correctly set, there seems to be a problem with the calculation.  As mentioned, we are UTC+10 (currently +11 for summer).  I suspect that Blesta is subtracting 11 hours from the server time as it is assuming the server is also in AEDT, but it is not -- the server is already in UTC.

  • 0
Posted

Update: I have created some new invoices today and the dates are displaying correctly.

 

Perhaps I had not set the system date correctly when I created the invoices yesterday.  It appears that the dates are stored in the database -11hrs from local midnight (i.e. 2014-02-19 00:00:00 is stored as 2014-02-18 13:00:00).  I had expected they would be stored as -11hrs from the time of creation, but as the billing/due dates don't use hours, minutes and seconds I can see why they are stored this way.

 

I hope this doesn't become a problem when we return back to standard time, as we will then be UTC+10 so 2014-02-18 13:00:00 in the database could become 2014-02-18 23:00:00 and possibly display as the previous day?

  • 0
Posted

I think I have found the problem, and it looks to be a bug.  When I create an invoice and save it as a draft, the Invoice Billed Date appears correctly in the interface but is the previous day when displayed on the PDF (we are in UTC+11 until this weekend, when we fall back to UTC+10).

  • 0
Posted

I can confirm that all PDFs (draft or not) show a the Invoice Date (Date Billed) and Due Date one day behind the interface. My timezone is UTC+12, start day Monday and I've tested this on both my Windows dev server and Ubuntu production server. I tested this on my dev server at 9:00 AM, the invoices on my production server were created a few days ago at around 5:00 AM.

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...