HubSpot Ideas

khughes

Multiple date formats on date property in personalization

Hi HubSpot,
Right now there is no way to change the date format on date properties in personalization on e-mails. The date property will always display in US format (mm/dd/yyyy). These dates can be very confusing and mislead europeans customers who are used to the dd/mm/yyyy format. Therefore, I am hoping that we get can get enough votes here and have the ability to choose multiple date formats on date properties in personalization on emails.

Thanks,
Christian

HubSpot Updates
May 21, 2020 07:51 AM

Hi @mpherr ,

 

Can you please send pictures of the where you are looking at these date formats so i know we are referencing the same screens. The following from your original post:

 

"in emails and logs"

And "in the dashboards"

 

Thank you,

 

Shane

Not Currently Planned
May 12, 2020 09:17 AM

Hi @khughes ,

 

Thank you for this idea, we are aware of this as a pain point and are reviewing how we can tackle this, but this is not planned for development in the next quarter. For transparency and clarity, I am updating this issue to 'Not currently planned' for the time being. I will update here once we have plans in place.

 

Best,

Shane

56 Replies
NPW
Contributor

@sejal_parikhFYI - This is a basic feature that should be included with HubSpot

NHowarth
Participant

I don't know if it helps anyone but I have a workaround for this issue by using custom code within a workflow if it is still a problem. Feel free to reach out if you would like me to give you the details. If there are a few then I will just post it as a reply here. 

TGeorge1
Participant

Any update @hubspot?

 

This is causing lots of confusion in our business (UK based). We have set all the default setting to UK but still have emails go out with U.S. format. 

 

Does not make any sense and is confusing our customers.

 

What is the status and why is this not updated yet? Looking at the replies to this thread, this is a common problem. 

mpherr
Contributor

This issue, the first comment dates back to 2017, has not been tackled or solved after 6 years and still has the status of "not currently planned!"

This is a standard!

NHowarth
Participant

@TGeorge1  & @mpherr 

 

I totally agree that this should be standard funtionality in any CRM product and I had a session with the HubSpot product managers about 9 month ago and told them this. It doesn't look like it is going to be fixed though.  

 

So I have resolved this using custom JS code in a workflow and calling the HubSpot API. This allows me to extract a date from a field and then format it into a date format that I want and store it in a custom field. Im currently storing it as a long format (5th March 2023) but that can be changed to any other format. 

I run this everyday against all of my deals to get a format against the deal that I can us to email the expiry date in a UK format. It works really well

I have my deal enrolment trigger on my workflow and the rest of my workflow looks like this 

 

NHowarth_0-1683181581714.png

My custom code action has the following code:

 

const hubspot = require('@hubspot/api-client');
exports.main = (event, callback) => {

// Set up the HubSpot API client
const hubspotClient = new hubspot.Client({
accessToken: process.env.sec_key
});

hubspotClient.crm.deals.basicApi.getById(event.object.objectId, ["license_requested"])
.then(results => {

let selectedDate = results.properties.license_requested;

//Test point to see what the date is
//console.log("end date is " + selectedDate);

let splitDate = selectedDate.split("-");

let dayNow = splitDate[2];
let monthNow = splitDate[1];
let yearNow = splitDate[0];
let daySuffix = "";

// console.log("Month now is " + monthNow);

switch (dayNow) {
case "1":
case "21":
case "31":
daySuffix = "st";
break;
case "2":
case "22":
daySuffix = "nd";
break;
case "3":
case "23":
daySuffix = "rd";
break;
default:
daySuffix = "th";
break;
}

let monthName = "";

switch (monthNow) {
case "01":
monthName = "January";
break;
case "02":
monthName = "February";
break;
case "03":
monthName = "March";
break;
case "04":
monthName = "April";
break;
case "05":
monthName = "May";
break;
case "06":
monthName = "June";
break;
case "07":
monthName = "July";
break;
case "08":
monthName = "August";
break;
case "09":
monthName = "September";
break;
case "10":
monthName = "October";
break;
case "11":
monthName = "November";
break;
case "12":
monthName = "December";
break;
default:
monthName = "Error";
break;
}

let cs_expiry_date = dayNow + daySuffix + " " + monthName + " " + yearNow;


callback({
outputFields: {
cs_license_expiry_date_long: cs_expiry_date
}
});
})
.catch(err => {
console.error(err);
});
}

 

I am happy to discuss and answer what questions I can. Hapy to be contacted directly as well.

 

MPenfold
Contributor

SOLUTION: 

TL;DR: Use a format data step in a workflow, with unicode standard formatting to create a duplicate property, formatted exactly as you want. 

 

I just ran into this same issue and having come up empty on the community, I had a play around to see if I could find a solution and have done, at least for my needs, hopefully works for lots of you too.

Note: I've used "Meeting Date" as the name of the example property that I want to reformat in the steps below. 

 

  1. You'll need to create an additional property to the date property you have, I'd suggest calling it the same name, but with "(String)" appended to the name to indicate that it's the text string, not an actual date property. So if you've got "Meeting Date" already, you need to create "Meeting Date (String)" as the new property, and make sure it's a Single Line Text type property. 
  2. Create a workflow (for whatever object type your date property is on i.e. if it's a Contact Property, you need a Contact workflow etc.) and set the enrolment criteria as "Meeting Date" is known (you may also want to turn re-enrolment on, if this is a date that will get updated in the future). 
  3. Use a "Format Data" step, selecting "Meeting Date" as the property to format, then "Change date format" and then choose the date format you need (refer to this unicode doc for the different codes e.g. "MMMM" will spit out the name of the month, "d" will spit out the day of the month as a number, so for a date input of 28/06/2023, "MMMM d" would spit out "June 28") - see screenshot below for reference.
  4. I'd recommend testing the workflow by removing any enrolment criteria (or creating a clone without any enrolment criteria) and then manually enrolling one contact/company/other object into it and checking if it spits out what you're expecting. 
  5. Once you've tested and turned your workflow on so it populates the data into all enrolled objects, you can use the new "Meeting Date (String)" property to insert correctly formatted dates into your emails using the personalization token.

    image 1 (2).png

    @khughes can you mark this as a solution so that anyone else that comes across your post will see it.
LeonardoDVinci
Contributor

I would just like to ask a question for those who proposed to implement this using workflows... does that work for meetings and activities?

MPenfold
Contributor

@LeonardoDVinci can you elaborate? What are you trying to achieve?

 

LeonardoDVinci
Contributor

Let's say you are trying to send a marketing email using activity details rather than contact property.

 

For example:

The client filled in a landing page form, scheduled a meeting, and filled in a client profile form.
You need to create a marketing email that a workflow would use to send an email for each form submission and a separate email for booked meetings done in a defined period (ex. month) and format the activity date in UK Date format since that's the client's location but your system date format is US.

 

I would assume that the solution wouldn't fix since contact properties can't handle multiple values. Not to question the solution but it's just me considering the worst-case scenarios.

MPenfold
Contributor

@LeonardoDVinci if I understand you correctly, you'd just have to use the same solution a few times - creating separate contact properties for each date that you want to show as a UK formatted date. So you'd have a property for landing page form submission date which is updated by a workflow each time the specific form is filled in, another for the client profile form, and another for the meeting booking. Then you could just insert the relevant property into the relevant email. Does that make sense?

 

fborgosano
Participant

Hello everyone,

 

I have the same issue of many others here. When a date comes into the body of an email, it comes with that horrible format dd/mm/yy. I'd need it to be dd/mm/yyyy and it would be great if I could choose further formats in the email templates editor (like, for example, Tuesday, September 5th 2023). I would use the dd/mm/yyyy format for the Italian contacts and "Tuesday, September 5th 2023" for the other ones. Is someone working on it?

Or is it already available the option to at least change the format by default to dd/mm/yyyy but I didn't find it in the settings?

I've been very very surprised that it wasn't available in first place. Hubspot is a very good and smart CRM, I still can't believe that there's not this option.

MPenfold
Contributor

@fborgosano there's no native fix for this yet but the solution I shared previously will work for you, you'll just need to recreate the date property multiple times, once for each of the formats you want to be able to put into the email.

ESteiner9
Member

Hubspot should not shorten the year on the email from 2023 to 23 when an internal email goes out. This makes a lot of our workflows not work.

This is not feature request. This is a bug fix. And I'm honestly tired of hubspot pretending bug fixes are feature requests. Stop adding more features into hubspot and not fixing your bugs. I've been a user for ten years and it's stuff like this that has me looking for alternatives. 

 

CCWXA
Member

@MPenfold The workaround you proposed requires paying $720/mo for Operations Hub Professional, to fix a bug caused by HubSpot, via the Format Data Workflow Action. Customers shouldn't be paying HubSpot to fix bugs created by HubSpot.

CCWXA
Member

Another use case is on the user interface/user experience. If HubSpot is going to allow users to set the Date format, where it is MM/DD/YYYY, as shown in the screenshot, then that formatting should be consistent throughout the HubSpot platform. Instead, it is not, when it comes to the Workflows feature of the platform, where Workflows spit out M/D/YY.

 

Screenshot 2023-11-03 at 4.38.49 PM.png

MankaB
HubSpot Employee

Posting on the behalf of a customer: 

Being able to set the dates using workflow personalisation to MM/DD/YYYY (and not only having the short version M/D/YY) is needed because: 
 
1) T
his is the same short-sighted programming that caused the Y2K bugs, back when programmers thought that we could never go higher than 99 for the year, and decided not to use 1999. Also, this messes up any sorting that they use when the data is transformed from one format to another.
2) Another use case is on the user interface/user experience. If HubSpot is going to allow users to set the Date format, where it is MM/DD/YYYY, then that formatting should be consistent throughout the HubSpot platform. Instead, it is not, when it comes to the Workflows portion of the platform.