I’m having a weird issue with dates in Google Sheets. When I create a PDF from my spreadsheet, the dates are off by one day. For example, if I put 29/12/2021 in a cell, the PDF shows 28/12/2021 instead. This is really frustrating because everything else works perfectly. I already tried adjusting the locale settings and timezone in my sheet but that didn’t fix anything. Has anyone run into this before? I’m wondering if there’s a way to solve this problem using Google Apps Script. Any help would be great!
I encountered a similar issue recently with some reports. It’s often due to how Google Sheets interprets data types during the export process. To avoid this, try entering your dates in the ISO format (yyyy-mm-dd). This ensures consistency when exporting to PDF. Additionally, using the DATE function like =DATE(2021,12,29) can help. This method allows Google Sheets to understand your intended date format better, resulting in accurate PDF exports. If you prefer scripting, a Google Apps Script can also be a viable workaround, though for simplicity, the DATE function has worked well for me.
i’ve had that too! try formatting your dates to dd/mm/yyyy. sometimes it helps with how sheets interprets the data when generating a pdf. so annoying, right?
This issue arises when the timezone settings in your browser do not align with those in Google Sheets. I’ve encountered a similar situation while preparing monthly reports, as the PDF export can interpret dates differently than what is displayed on the screen. To resolve this, navigate to File > Spreadsheet settings and ensure that both the timezone and locale are in sync with your browser settings. Additionally, utilizing DATEVALUE with TEXT formatting on the affected date cells can standardize date handling during exports. If problems persist, consider creating a Google Apps Script to format the dates prior to PDF generation.