Save current date but not time

Hello,

I need to save the date an email has been sending at but not the time. How can I save only the date?
day-sent = current date

image

Just set the hours/minutes/seconds to 0

Thanks @nigel

This actually works on the front when adding change seconds/hours/minutes to 0 in input or text fields. But when running this formula from the backend (schedule a workflow) it does not work. see formula below.

Any thoughts?

image

Is it changing the time at all? You are probably zeroing out your time (12:00 AM) in the UTC timezone. API workflows use this timezone by default.

This is exactly what is happening.

image

Are we looking at a screenshot of the API workflow log or the resulting list of things under ‘app data’ that is written by this workflow? I’d check and see if there is a user who ‘launched’ this API workflow, in that case the workflow may be inheriting different local timezone of the individual users depending on how it was called.

You can try also try converting your date to text mm/dd/yyyy and then using a text to date plugin, which when run server-side should always return a UTC date at 12:00AM

Hello!

If day-sent is a date field it will save the entire date. Think of a date as a number field where the value saved is a milliseconds number.

What you can do is display it to your users in different fashions. Consider using :formatted as

You can of course just ignore the time. Unless that is causing timezone issues?

1 Like

I have a similar question. The time element of the date field causes issue while comparing 2 dates. Even though the date element is same, the time part of it can cause issue in comparing.

Hello @gabajaj and welcome to the Bubble community!

This thread may be interesting:

This topic was automatically closed after 70 days. New replies are no longer allowed.