Feb 08, 2021 10:50 AM
Hi,
I am reading a date from a field and want to include it in an email (as part of an automation).
How do I go about converting the date that looks like this “2021-02-10t11:30:00.000z” into something like this - 10/02/2021 11:30am (or similar)?
Thanks!
Solved! Go to Solution.
Feb 08, 2021 11:04 AM
This is more of a JavaScript question than an Airtable question.
You can convert a JavaScript date object to a string using any of the to...String()
methods available for date objects. They are documented here. You probably want toLocaleString(). You can specify options to get the exact formatting that you want.
Feb 08, 2021 11:04 AM
This is more of a JavaScript question than an Airtable question.
You can convert a JavaScript date object to a string using any of the to...String()
methods available for date objects. They are documented here. You probably want toLocaleString(). You can specify options to get the exact formatting that you want.
Feb 08, 2021 12:07 PM
This was helpful thanks! I didnt realise that those options were not available to me because I was trying to use them on a string :slightly_smiling_face:
Thanks!