How to get datetime field in format dd/mm/yyyy hh:mm:ss format using formula field. I have date time as "9/12/2016 5:21 PM" but i want it as "12/9/2016 5:21 PM"
[SalesForce] is there anyway to get datetime field in format dd/mm/yyyy hh:mm:ss format using formula field
Related Topic
- [SalesForce] Change Date Format in Formula Field
- [SalesForce] Convert String to Date in Formula Field (and then get the YEAR)
- [SalesForce] nyway to get in DD/MM/YYYY or MM/DD/YYYY format
- [SalesForce] Help in converting string to datetime in correct format
- [SalesForce] String (‘yyyy-MM-dd’) to date using date.parse returns (‘yyyy-MM-dd hh:MM:ss’)
Best Answer
Yes.
When you create a formula field, you would need to set it to return
DateTime
:You'd need to explain in a bit more detail as to what your problem might be, but as you can see from the example there, you can use functions such as
NOW()
which would return the currentDateTime
.The format that is returned depends on your Locale Settings.
If something like
M/D/Y H:M:S
is being returned instead of something likeD/M/Y H:M:S
and you'd prefer the latter, you can adjust the settings by going to...... And adjusting the Locale setting there.
Edit
You could use a formula field to return a
String
(text) and use the following to construct your preferredDateTime
:Basically here we're using the
MID
method to cut theDateTime
based on their start position and how many characters we want to select. This will createDD/MM/YYYY HH:MM
. Don't copy the comments into the formula.