Re: Way to Change Datetime to Date no time?

Anonymous
Not applicable

Way to Change Datetime to Date no time?

I would like to sync from my database to Marketo with a field that is datetime on the database side. Is there a way to sync this field as datetime, and then use some sort of function to only display the date (and not the time) in an email?

Ex. Sync produces 11/3/12 3:45 pm  to Marketo, but I would like to display only 11/3/12 in an email using tokens.

I'm thinking that I will just have to sync over only date and disregard the time, but wanted to see if there was a solution to keep the datetime data yet change display in Marketing Activities assets.

Thanks in advance for the help!
Tags (1)
4 REPLIES 4
Matt_Stone2
Level 9

Re: Way to Change Datetime to Date no time?

I don't believe this is possible with Marketo... what goes into those fields is what comes out and you can't manipulate it like you might with PHP.

You could consider splitting them into two fields: one for the date and one for the time, then if you ever need to have both, you can just concatenate them, or you can use them individually. That being said, you'd have to split the values apart on your DB side, which I don't know if you could do.
Anonymous
Not applicable

Re: Way to Change Datetime to Date no time?

You can only change the data type of a custom field. I'd be curious to see if changing a custom datetime field to a date type in Marketo, leaving it datetime in SFDC. I'm not sure if it would truncate to just the date or yield a data type mismatch in the sync and be skipped.

I think that Matt is onto something with the custom filed approach. Create a new custom field in SFDC and populate it with a forumula that formats the data exactly as you want it displayed. Then reference the custom field in your email/landing page/snippet.
Anonymous
Not applicable

Re: Way to Change Datetime to Date no time?

We do not currently have a CRM and instead sync to our main database, so I'm gussing I will need to do some work on our sync code. It's unfortunate that you cannot display only pieces of a field when needed.

Thanks for your help anyways! I'll keep it in mind when we begin to use a CRM in the future.
Matt_Stone2
Level 9

Re: Way to Change Datetime to Date no time?

If you're already using custom coding to sync with the Marketo API and your database, it shouldn't be too difficult to split the datetime into two fields and store them separately. I know that's not what you want, but you should get the same result. Good luck!