Loading
Feature Disruption - Service Cloud VoiceRead More
Feature degradation | Gmail Email delivery failureRead More
Visual Studio Code Based Modeler for Consumer Goods Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          convertAnsiDateTime2AnsiDate(string)

          convertAnsiDateTime2AnsiDate(string)

          Converts an input parameter (string) containing date and time in ANSI format to date in ANSI format by removing the time component from the input.

          Required Editions

          Available in: Lightning Experience in Professional, Unlimited, and Enterprise Editions that have Consumer Goods Cloud enabled.

          Parameters

          String: Date and time in ANSI format. The table lists some valid ANSI formats for date and time.

          • yyyy-mm-dd hh:mm:ss (for example, 2020-04-04 00:00:00)
          • yyyy-mm-ddThh:mm:ss ("T" is used as a separator between date and time. For example, 2020-04-04T00:00:00)

          Returns

          String: Date in ANSI format.

          Sample Usage

          Utils.convertAnsiDateTime2AnsiDate(sampleANSIdatetime)

          Example Results of convertAnsiDateTime2AnsiDate(string)

          string Result
          2020-07-11T12:34:56 2020-07-11
          2020-07-11 12:34:56 2020-07-11
          2020-12-11 00:00:00 2020-12-11
          Important
          Important If the input parameter for the convertAnsiDateTime2AnsiDate(string) function isn’t a string or is in a format other than ANSI, no default result is returned. Instead, a Framework error is logged.
           
          Loading
          Salesforce Help | Article