Date format issue

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2047
    rajyaguru
    Participant

    Hi All,

    I have a date printing issue in Invoice pdf. There are two invoicing installatios on servers one with old version 7.4 and another with new version 8.2.

    In PHP 7.4 and below Old version SI below code was printing date in invoice as Apr 01, 2024

    phpSettings.date.timezone = Europe/London
    local.locale = en_GB
    local.precision = 2

    IN PHP 8.2 and above SI invoice link same kind of below code printing value as : 04/01/2024

    phpSettingsDateTimezone = Europe/London
    local.locale = en_GB
    local.precision = 2

    I wanted to print Apr 01, 2024 in Invoice or 01-Apr-2024 in 8.1PHP version

    Any help would be appreciated to achive this requirement in PHP 8.2 or latest version. Or please suggest the code detail which needs to be revised.

    #2048
    RRowley
    Participant

    This is likely due to the changes to use globalization for date, number, etc. formats. You need to make your own version of the template is you aren’t already. See the “Invoice Templates & Styles” topic on the left. Once you have your own template version, edit the template.tpl file to use the international date with the format of long. Here is an example of what this would look like:

    field={$invoice.date_original|utilIntlDate:$invoice.locale:"long"}

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.