https://supabase.com/ logo
#help
Title
# help
x

xavier

03/28/2022, 2:28 PM
Hey guys, is there a way to have the Current date as default value of a column in supabase?
n

Needle

03/28/2022, 2:28 PM
Hello ! This thread has been automatically created from your message in a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
x

xavier

03/28/2022, 2:28 PM
I tried
CURRENT_DATE
but it didn't worked…
g

garyaustin

03/28/2022, 2:33 PM
If you are talking on postgres side ... now()
n

Needle

03/28/2022, 2:33 PM
xavier (2022-03-28)
x

xavier

03/28/2022, 2:33 PM
I need a date, now() will give something like
2022-02-21
?
g

garyaustin

03/28/2022, 2:33 PM
Ah, that is for a timestamp column
x

xavier

03/28/2022, 2:34 PM
Yes, that's what I thought. I would like the same but for a Date
g

garyaustin

03/28/2022, 2:36 PM
If your column is date type that works too.
x

xavier

03/28/2022, 2:37 PM
Hum, it didn't. I might have a bug elsewhere. Let me check
g

garyaustin

03/28/2022, 2:38 PM
Hard to see, but column gets 2022-03-28
x

xavier

03/28/2022, 2:40 PM
Works!
Thanks man!
r

ryanhiebert

03/28/2022, 10:28 PM
Careful! What timezone do you want the date to be in? Make sure it will do what you're expecting!