本文整理汇总了PHP中ilFormat::ftimestamp2dateDB方法的典型用法代码示例。如果您正苦于以下问题:PHP ilFormat::ftimestamp2dateDB方法的具体用法?PHP ilFormat::ftimestamp2dateDB怎么用?PHP ilFormat::ftimestamp2dateDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilFormat
的用法示例。
在下文中一共展示了ilFormat::ftimestamp2dateDB方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildExportFileXLS
/**
* build xml export file
*/
function buildExportFileXLS()
{
global $ilBench;
$ilBench->start("QuestionpoolExport", "buildExportFile");
include_once "./Services/Excel/classes/class.ilExcelWriterAdapter.php";
$adapter = new ilExcelWriterAdapter($this->export_dir . "/" . $this->filename, FALSE);
$workbook = $adapter->getWorkbook();
$workbook->setVersion(8);
// Use Excel97/2000 Format
$format_bold =& $workbook->addFormat();
$format_bold->setBold();
$format_percent =& $workbook->addFormat();
$format_percent->setNumFormat("0.00%");
$format_datetime =& $workbook->addFormat();
$format_datetime->setNumFormat("DD/MM/YYYY hh:mm:ss");
$format_title =& $workbook->addFormat();
$format_title->setBold();
$format_title->setColor('black');
$format_title->setPattern(1);
$format_title->setFgColor('silver');
$worksheet =& $workbook->addWorksheet();
$row = 0;
$col = 0;
// title row
include_once "./Services/Excel/classes/class.ilExcelUtils.php";
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt("title"), "latin1"), $format_title);
$col++;
$worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt("description"), "latin1"), $format_title);
$col++;
$worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt("question_type"), "latin1"), $format_title);
$col++;
$worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt("author"), "latin1"), $format_title);
$col++;
$worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt("create_date"), "latin1"), $format_title);
$col++;
$worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt("last_update"), "latin1"), $format_title);
$col = 0;
$row++;
$questions = $this->qpl_obj->getQuestionList();
foreach ($questions as $question) {
$worksheet->write($row, $col, ilExcelUtils::_convert_text($question["title"], "latin1"));
$col++;
$worksheet->write($row, $col, ilExcelUtils::_convert_text($question["description"], "latin1"));
$col++;
$worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt($question["type_tag"]), "latin1"));
$col++;
$worksheet->write($row, $col, ilExcelUtils::_convert_text($question["author"], "latin1"));
$col++;
// ilDatePresentation::formatDate(new ilDateTime($question["created"],IL_CAL_UNIX))
$worksheet->write($row, $col, ilExcelUtils::_convert_text(ilFormat::formatDate(ilFormat::ftimestamp2dateDB($question["created"]), "date"), "latin1"));
$col++;
$worksheet->write($row, $col, ilExcelUtils::_convert_text(ilFormat::formatDate(ilFormat::ftimestamp2dateDB($question["tstamp"]), "date"), "latin1"));
$col = 0;
$row++;
}
$workbook->close();
ilUtil::zip($this->export_dir . "/" . $this->filename, $this->export_dir . "/" . $this->zipfilename);
if (@file_exists($this->export_dir . "/" . $this->filename)) {
@unlink($this->export_dir . "/" . $this->filename);
}
}