Skip to content

insertDate with standard format value changes the dates to show as numbers #544

Open
@DAdq26

Description

@DAdq26

Hi
The issue (#527) seems to be still active with php 8.3 and xlswriter 1.5.8 release..
On my own

image

image

Code to reproduce

image


<?php

use Vtiful\Kernel\Excel;

require_once "../External/autoload.php";

$excel = new Excel(['path' => dirname(__DIR__) . '/Cache']);

$dateFile = $excel->fileName("free.xlsx")
    ->header(['date']);
$dateFile->insertDate(1, 0, time(), 'yyyy-mm-dd hh:mm:ss');
$dateFile->output();

Expected result

date
2024-09-19 xx:xx:xx

Actual Result

date
45638.655

if i try your example here https://xlswriter-docs.viest.me/en/dan-yuan-ge/cha-ru-date


<?php
$excel = new \Vtiful\Kernel\Excel($config);

$dateFile = $excel->fileName("free.xlsx")
     ->header(['date']);

$dateFile->insertDate(1, 0, time(), 'mmm d yyyy hh:mm AM/PM');

$textFile->output();

The result is the same...

Any fix on your side?

Best

Originally posted by @DAdq26 in #527 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions