Getting a date-time field and returning just the time in a different format

Getting a date-time field and returning just the time in a different format

I'm currently trying to write a script where it grabs a date-time field, reads only the time, and changes the time to a new time from a time field. So far this is what I have: 
  1.  eventTime = rec.Start.getTime();
  2. eventTime = eventTime.toString("yyy-MM-dd","HH:mm:ss");
  3. info eventTime;
  4. newHour = input.New_Time.getHour();
  5. newMinutes = input.New_Time.getMinutes();
  6. newSeconds = input.New_Time.getSeconds();
  7. newTime = newHour + ": " + newMinutes + ":" + newSeconds;
  8. newTime = newTime.toString();
  9. info newTime;
It's currently returning the time  but I'm trying to figure out how to change the time. I first tried the toTime() and toString(), but it's not changing the format of it.



    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方