aVadim483 / fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP
MIT License
163 stars 31 forks source link

set Date format in Locale Settings #44

Closed lollita closed 10 months ago

lollita commented 10 months ago

I have to get the date format as: DD/MM/YYYY It work in Windows server but not in Linux server where it become: YYYY/MM/DD I tryed to force with

$excel->style->setLocaleSettings([
      'formats' => [
          '@DATE' => 'DD-MM-YYYY',
          '@TIME' => 'HH:MM:SS',
          '@DATETIME' => 'DD-MM-YYYY HH:MM:SS',
          '@MONEY' => '# ##0,00',
      ],
  ]
);

And it works. Do it is the right via?

aVadim483 commented 10 months ago

Yes, this is one of the working ways