Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NirmalBalajiTU opened this issue Jul 23, 2024 · 0 comments
Open

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

NirmalBalajiTU opened this issue Jul 23, 2024 · 0 comments

Comments

@NirmalBalajiTU
Copy link

NirmalBalajiTU commented Jul 23, 2024

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',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant