function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
siddarth rajsiddarth raj 

Datetime instance in the format of HHMMSS

Hi all,

In our project integration to the third party, we have one element deliverydatetime expecting in datetime and in the format of 'HHMMSS'.

Can any one have idea how to convert the deliverydatetime into HHMMSS and it should in datetime isntance not an String.

appreaciate any help indeed.


Leslie  KismartoniLeslie Kismartoni
This is pretty unclear... A datetime has both a date and a time...

So you have a field called deliverydatetime, which is a date time? And you just want the hours,minutes and seconds? What is the date it corresponds to?

If the date doesn't matter, why not just use a string?

siddarth rajsiddarth raj
Firstly Sorry for My Bad English. and Thanks for your trail to understnad

You are right. I have the field deliverydatetime, which id datetime type. From this datetime value i have to send only time in HHMMSS format to the third party from salesforce callout.  

Problem here is i can't get  the datetime in the format they (third party) are expecting. In detailed  they are this value in type of Time and in the format of HHMMSS i.e equalant to datetime in salesforce. So while callout I have the only option is creating datetime instance with the only time and also that must retrun in HHMMSS looks like this is not possible.

I am here forum to find any work around to get this.  Other wise the only option i have is to check with the service porvider to change that into string type rather time.