Question

MySQL to Google Sheets

  • 24 October 2020
  • 3 replies
  • 78 views

Hi,

 

I hope everyone is well. I have linked my MySql database to Google Sheets. It works fine except for the date fields. The date field, for example ‘03/04/2020’ shows as ‘1583272800’ on the Google Sheet.

 

Any assistance would be appreciated.

 

Thank you


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Thank you guys, I appreciate it. Problem solved!

You can also solve this by converting the UNIX time to datetime in the mysql query itself. You can cast unix time to datetime by using the FROM_UNIXTIME() function

 

Example

SELECT coumn1, column2 FROM_UNIXTIME(column3_date) FROM table
Userlevel 7
Badge +14

That can be addressed a few ways.

The date format you’re seeing is a UNIX timestamp: https://en.wikipedia.org/wiki/Unix_time

OPTIONS

You can adjust the formatting of the column in the GSheet to the desired date format.

Location: Top nav bar > Format

 

You can add a formula in the GSheet step for the field to set the format of the date.

Example:

 

You can add a Formatter step in the Zap to set the format of the date to MM/DD/YYYY

App: Formatter > Date/Time > Format