You need to sign in to do that
Don't have an account?
Lil_Ranger1111
DateTime Text Formula Field
Hi,
I have a formula field to pull the created date with the time, but it is showing the seconds and the z. How do I get rid of the seconds and z? I've tried a couple of different ways and can get just the date or just the time, but not both.
I have a formula field to pull the created date with the time, but it is showing the seconds and the z. How do I get rid of the seconds and z? I've tried a couple of different ways and can get just the date or just the time, but not both.
TEXT(CreatedDate)
All Answers
https://developer.salesforce.com/forums?id=906F00000008uO1IAI
MID(TEXT(CreatedDate),6,2) & "-" & MID(TEXT(CreatedDate),9,2) & "-" & MID(TEXT(CreatedDate),1,4)
That strips out the various characters in the date/time and rearranges them.
TEXT(MONTH(DATEVALUE(CreatedDate))) & "-" & TEXT(DAY(DATEVALUE(CreatedDate))) & "-" & TEXT(YEAR(DATEVALUE(CreatedDate)))
This will give you 5-26-2014, the other MID option will give you 05-26-2014.
This one might be easier to read if having to reference it.
Also, the DATEVALUE is used because the MONTH, DAY and YEAR functions only work with dates, not date/times. So DATEVALUE converts a date/time to a date.
Hi Jason,
Below formula not working...
LEFT(TEXT(CreatedDate), 16)
It shows correct date and showing wrong time.
Date/Time: 1/7/2015 8:56 PM
Formula Output: 2015-01-07 15:26
Hi Jason,
I also have the same concern that Mano has, when we convert the date-time field in text, it shows the wrong time.
Could anyone plz provide the solution for this problem.