Ask Search:
Saurabh SoodSaurabh Sood 

Convert text to Date/time

Hi
Could anyone tell if it is possible to convert text field
User-added imageAppoitment D is Text field, using for date
Appoitment T is Text field, using for time
Appoitment Date/Time is formula field return type of Date/TIme

Formula is DATETIMEVALUE(Appoitment_D__c +" "+ Appoitment_D__c+':00')
But getting error! 
 
Best Answer chosen by Saurabh Sood
Deepak AnandDeepak Anand
It returns GMT time value. So you will have to add your GMT offset(such as +5h 30m for IST and so on) to get the true time.

All Answers

Deepak AnandDeepak Anand
Can you set the Return Type to just text and write this = 
Appoitment_D__c + " " + Appoitment_D__c + ":00"
What do you see printed on the page ?
Deepak AnandDeepak Anand
Oh! Wait I think you used the same field twice.

You should be writing - 
DATETIMEVALUE(Appoitment_D__c + " " + Appoitment_T__c + ":00")
Saurabh SoodSaurabh Sood
Hi Deepak,

Oh! My blunder But now it's calculating wrong Idon't know why
I have entered Appotiment date = 04/15/2018 and Appoitment Time =3:10 Pm

User-added image

User-added image  
Deepak AnandDeepak Anand
It returns GMT time value. So you will have to add your GMT offset(such as +5h 30m for IST and so on) to get the true time.
This was selected as the best answer
Saurabh SoodSaurabh Sood
Thanks alot <3