Change Date Time Format

Moderator: crythias

Locked
robs
Znuny newbie
Posts: 2
Joined: 08 Jan 2014, 11:13
Znuny Version: OTRS 3.3
Real Name: Robert
Company: Genesys Integrated Indonesia

Change Date Time Format

Post by robs »

Hi All

Yesterday i tried to change the date format in OTRS 3.3 on the location / opt / OTRS / Kernel / Language / en.ca. I tried to change the format of the date to dd/mmm /yyyy. ex (8/jan/2014), but could not. please help to resolve it.

thank you.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Change Date Time Format

Post by crythias »

What did you change?
What did you try?
Where did you expect to see the result?
What did you expect to see?
What did you actually see?
How would we be able to replicate your issue?

cd Kernel/Language
grep DateFormatShort *

Ideally, if you need to make it custom, you will want to copy xx_Custom.pm to en_CA_Custom.pm and apply changes within so it will survive updates.

Also make sure your agent or customer preferences are set that your language is en_CA.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
robs
Znuny newbie
Posts: 2
Joined: 08 Jan 2014, 11:13
Znuny Version: OTRS 3.3
Real Name: Robert
Company: Genesys Integrated Indonesia

Re: Change Date Time Format

Post by robs »

Hi crythias.

Thank you for the direction. I have Change in the en.ca file. i try to change the the coding from ( $Self-->{DateFormat} = '%M/%D/%Y %T' ) to be ( $Self-->{DateFormat} = '%D/%B/%Y %T' ) but not working. and the result is in my attachment.
My Expectation is the results of the format date was changed to '%D/%B/%Y %T' (example : 13/Dec/2013 08:00) in the all of the webpage OTRS. for the information my Language is en.pm.
Please help.
Thanks you
You do not have the required permissions to view the files attached to this post.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Change Date Time Format

Post by crythias »

It's a bug.

The short (?) answer is that Language.pm sub FormatTimeString doesn't parse %B (or %A, but let's just fix %B for now).

edit Kernel/Language.pm

around line 367? you should see and modify that it looks like this:

Code: Select all

        if ($Short) {
              $T =~ s/(\d\d:\d\d):\d\d/$1/g;
          }
          my @MONS = qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/; #add this line. Optionally, translate it
          $ReturnString =~ s/\%T/$T/g;
          $ReturnString =~ s/\%D/$D/g;
          $ReturnString =~ s/\%M/$M/g;
          $ReturnString =~ s/\%Y/$Y/g;
          $ReturnString =~ s{(\%B)}{$Self->Get($MONS[$M-1]);}egx; #add this line
Please submit a bug report to bugs.otrs.org pointing to this thread.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Locked