Reformat date and time with now()

Hi @Gregg_Stebben :blush: !

Now() takes a precision optional input such as "second", "minute", "hour" and "day" (the default being "second").

So, using:

  • Now() or Now("second") will output something like:

    • 3/3/2023 10:11:12 AM ( M/D/YYYY hh:mm:ss A ) and will refresh every seconds
  • Now("minute") will output something like:

    • 3/3/2023 10:11 AM ( M/D/YYYY hh:mm A ) and will refresh every minutes
  • Now("hour") will output something like:

    • 3/3/2023 10:00 AM ( M/D/YYYY hh:00 A ) and will refresh every hours
  • Now("day") is the equivalent to Today() and will output something like:

    • 3/3/2023 ( M/D/YYYY ) and will refresh every days

And I have a small suggestion to make here, regarding this :

Why not use a formula such as:

Format(
  "{1}: {2}{3}",
  Now("minute"),
  LineBreak(),
  thisRow.Notes
)

In this Format() formula the placeholders in the template ("{1}: {2}{3}") will be replaced, once the formula runs, by :

  • {1} β†’ Now("minute")
  • {2} β†’ LineBreak()
  • {3} β†’ thisRow.Notes

Which should give you the same result you probably already have using

Format(now())+": "+LineBreak()+thisRow.Notes

It’s just that it’s not recommended tu use + to concatenate things within Coda.
+ is, more often than not in these cases interpreted as the addition operator and can lead to weird looking/erroneous results down the line :innocent:

1 Like