Convert String to Date

Convert String to Date

Hi There,

I am trying to convert a string to a date with MM/dd/yyyy formatting but I cannot get it to work. 

The field Departure_Date_Website holds the value of: Sep 09, 2024

  1. resp = zoho.crm.getRecordById("Leads", recordid);
  2. stringdate = resp.get("Departure_Date_Website");
  3. departuredate = stringdate.toDate("MM/dd/yyyy");
  4. mp = map();
  5. mp.put("Departure_Date" : "departuredate");
  6. update = zoho.crm.updateRecord("Leads", recordid, mp);

      Zoho Developer Community

                                Zoho Desk Resources

                                • Desk Community Learning Series

                                • Digest

                                • Functions

                                • Meetups

                                • Kbase

                                • Resources

                                • Glossary

                                • Desk Marketplace

                                • MVP Corner

                                • Word of the Day

                                    Zoho Marketing Automation

                                            Manage your brands on social media

                                                  Zoho TeamInbox Resources

                                                    Zoho DataPrep Resources

                                                      Zoho CRM Plus Resources

                                                        Zoho Books Resources

                                                          Zoho Subscriptions Resources

                                                            Zoho Projects Resources

                                                              Zoho Sprints Resources

                                                                Qntrl Resources

                                                                  Zoho Creator Resources

                                                                    Zoho WorkDrive Resources

                                                                      Zoho Campaigns Resources

                                                                        Zoho CRM Resources

                                                                        • CRM Community Learning Series

                                                                          CRM Community Learning Series

                                                                        • Tips


                                                                        • Functions


                                                                        • Meetups


                                                                        • Kbase


                                                                        • Resources


                                                                        • Digest


                                                                        • CRM Marketplace

                                                                          CRM Marketplace

                                                                        • MVP Corner

                                                                          MVP Corner

                                                                            Design. Discuss. Deliver.

                                                                            Create visually engaging stories with Zoho Show.

                                                                            Get Started Now