Name and Date combined


#1

I am trying to create a name field with the name and the date:

{Client Name} & “-” & {Date of Service}

But it looks like this:

Jennifer Grube-2018-07-16T00:00:00.000Z

Why is it attaching the time part at the end? on the date of service field I have time turned off.


#2

I am not sure if that is a bug or the expected behaviour, but you could use DATETIME_FORMAT to get the part you want.


#3

I noticed something similar. In one of my tables a formula refers to a datefield. It displays it correctly (MM/DD/YYYY) but on my cell phone I saw the same “T00:00:00.000Z” added to it.
Also Airtable seems to add this extension in the totals area when you use Range for example. In another table I used Range to display the span of time I started entering data in that specific table. It used to show me the days, but for some reason it added the same extension there. Obviously there is no way to correct that there.
In the formula above your solutions works (DATETIME_FORMAT).


#4

When you combine anything with a string, the result is a string. In this case, you’re concatenating an unformatted Unix date value to a string, so the resulting representation will be based on the ‘raw’ date field.

You have the right idea — to apply a format — but your execution is slightly off. The ‘formatting’ tab in a field configuration only applies to the visual presentation of the value when that field is displayed. As you discovered, it has no effect outside of this.

As @Elias_Gomez_Sainz and @Andre_Zijlstra suggested, what you want to do is use DATETIME_FORMAT() to convert the date value into a string representation in a specified format before concatenating it with the client name. In this case, the format you want is defined as 'M/D/YYYY'. (There are virtually limitless variations possible; see the full list of format specifiers here.) Accordingly, your modified formula would be

{Client Name}&'-'&DATETIME_FORMAT( {Date of Service},'M/D/YYYY')