Date entered into database is a day earlier than the input

I have a scenario with a webhook and an MS SQL Server module to input a new record but the date of birth is sometimes entered into the database a day early. Initially, the value was passed directly as a string from the webhook, but even after trying various methods including parseDate and formatDate the date is still incorrect.

I checked the values shown after executing the scenario and it shows the correct date until I hover over it and then it shows as a day earlier. any ideas what I’m doing wrong?

wrong date

blueprint.json (29.7 KB)

Welcome to the Make community!

Looks like you are in the +1 timezone offset.

Simply put, when you are creating a date variable, you also need to specify the timezone to match the timezone of the SQL database server.

Assuming your SQL server is set to the UTC timezone,

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

Getting Started

Help Centre Basics

Articles & Videos

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

2 Likes

I thought I had tried that, but maybe it was with formatDate or I did something wrong. Anyway, It’s working now so thanks for the help.

2 Likes

No problem, really glad I could help!

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.