Token dates in emails are an unacceptable format | Community
Skip to main content
New Participant
January 9, 2024
Solved

Token dates in emails are an unacceptable format

  • January 9, 2024
  • 1 reply
  • 2127 views

I imported a spread sheet that has a date of birth field with a field type of  'date' . The date of birth was formatted in a csv as  05/18/2084 and uploaded to that person's data. The database > info > date of birth field in the person data shows, May 18, 2084. The email I've sent out has a token to get the person's dob, {{lead.Date of Birth:default=edit me}}. The email in their inbox displays that as, 2084-05-18. Where is the setting to fix how tokens render the date in SMS or email? Or is there another setting somewhere to change so the dob is in an acceptable format?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Well, ISO yyyy-MM-dd is a pretty standard format (the only internationally unambiguous format).

 

If you want friendly localized format, use Velocity $date.format.

 

Ensure you’re working with real Java dates using the timezone guidance at

Velocitips: Switch email content based on day/time

 

 

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
January 9, 2024

Well, ISO yyyy-MM-dd is a pretty standard format (the only internationally unambiguous format).

 

If you want friendly localized format, use Velocity $date.format.

 

Ensure you’re working with real Java dates using the timezone guidance at

Velocitips: Switch email content based on day/time

 

 

New Participant
January 9, 2024

Why is it doing that? Changing the format from what is uploaded and is in the database?

SanfordWhiteman
New Participant
January 9, 2024

Dates aren’t stored as strings.

 

They’re stored as SQL Dates, which take only 3 bytes (it would take a wasteful 10 bytes to store the literal 10 characters “2024-01-01”).

 

The standard output format is yyyy-MM-dd, but they’re not actually stored that way. The reason you can use a (small) range of recognized import formats is the database knows how to turn them all into Dates on the way in.