Skip to content

Date Time and MM and YYYY not working!! #362

@NirmalBalajiTU

Description

@NirmalBalajiTU

In the documentation code given example not working!

	$sheet2header = array(
		'col1-date'=>'date',
		'col2-datetime'=>'datetime',
		'col3-time'=>'time',
		'custom-date1'=>'YYYY-MM-DD',
		'custom-date2'=>'MM/DD/YYYY',
		'custom-date3'=>'DD-MMM-YYYY HH:MM AM/PM',
		'custom-date4'=>'MM/DD/YYYY HH:MM:SS',
		'custom-date5'=>'YYYY-MM-DD HH:MM:SS',
		'custom-date6'=>'YY MMMM',
		'custom-date7'=>'QQ YYYY',
		'custom-time1'=>'HH:MM',
		'custom-time2'=>'HH:MM:SS',
	);
	$pi = 3.14159;
	$date = '2018-12-31 23:59:59';
	$time = '23:59:59';
	$amount = '5120.5';

	$writer = new XLSXWriter();
	$writer->setAuthor('Some Author');
	$writer->writeSheetRow('BasicFormats',array($pi,$pi,$pi,$pi,$pi,$pi,$pi,$pi,$pi) );
	$writer->writeSheetHeader('Dates',$sheet2header);
	$writer->writeSheetRow('Dates',array($date,$date,$date,$date,$date,$date,$date,$date,$date,$date,$time,$time) );
	$writer->writeSheetRow('Currencies',array($amount,$amount,$amount,$amount,$amount,$amount,$amount,$amount,$amount) );

EXCEL RESULT ::: 2018-12-31 | 2018-12-31 23:59:59 | 23:59:59 | 2018-12-31 | 12-31-2018 | 31-Dec-2018 11:59 PM | 12-31-2018 23:59:59 | 2018-12-31 23:59:59 | 18 December | QQ 2018 | ########## | ##########

THESE 2 NOT WORKING
* 'custom-time1'=>'HH:MM',
* 'custom-time2'=>'HH:MM:SS',

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