Share feedback, ideas and get community help

Updated 3 months ago

Automatically determine today's date

Hello could you please help me?
How can my assistant automatically determine today's date?
B
S
M
5 comments
Use a Set variable block with the Now option πŸ™‚
Hi Batiste! I tried to use JS to format Now's output into a variable, for example {{data_agora}}, I looked in the documentation but couldn't find it. How can I format this date to DD/MM/YYYY? How to concatenate inline? {{=={{date_now}}.formatDate(DD:MM:YY)==}} ?
I use this variable

const currentDate = new Date();
const humanFriendlyDate = currentDate.toLocaleString();
return humanFriendlyDate;

so to can have the variable that's manageable in my flow with this format DD/MM/YYYY, HH:MM:SS AM
Perfetto! Thanks!

const currentDate = new Date(); // Format date DD/MM/YYYY function formatDate(date) { const day = String(date.getDate()).padStart(2, '0'); const month = String(date.getMonth() + 1).padStart(2, '0'); // Month init 0 const year = date.getFullYear(); return ${day}/${month}/${year}; } const humanFriendlyDate = formatDate(currentDate); return humanFriendlyDate;
happy to have helped you
Add a reply
Sign up and join the conversation on Discord