{
    "mode": "perldoc",
    "parameter": "Spreadsheet::XLSX::Utility2007",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Spreadsheet%3A%3AXLSX%3A%3AUtility2007/json",
    "generated": "2026-06-12T18:09:16Z",
    "synopsis": "use strict;\n#Declare\nuse Spreadsheet::XLSX::Utility2007 qw(ExcelFmt ExcelLocaltime LocaltimeExcel);\n#Convert localtime ->Excel Time\nmy $iBirth = LocaltimeExcel(11, 10, 12, 23, 2, 64);\n# = 1964-3-23 12:10:11\nprint $iBirth, \"\\n\";       # 23459.5070717593\n#Convert Excel Time -> localtime\nmy @aBirth = ExcelLocaltime($iBirth, undef);\nprint join(\":\", @aBirth), \"\\n\";   # 11:10:12:23:2:64:1:0\n#Formatting\nprint ExcelFmt('yyyy-mm-dd', $iBirth), \"\\n\"; #1964-3-23\nprint ExcelFmt('m-d-yy', $iBirth), \"\\n\";     # 3-23-64\nprint ExcelFmt('#,##0', $iBirth), \"\\n\";      # 23,460\nprint ExcelFmt('#,##0.00', $iBirth), \"\\n\";   # 23,459.51\nprint ExcelFmt('\"My Birthday is (m/d):\" m/d', $iBirth), \"\\n\";\n# My Birthday is (m/d): 3/23",
    "sections": {
        "NAME": {
            "content": "Spreadsheet::XLSX::Utility2007 - Utility function for Spreadsheet::XLSX\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use strict;\n#Declare\nuse Spreadsheet::XLSX::Utility2007 qw(ExcelFmt ExcelLocaltime LocaltimeExcel);\n\n#Convert localtime ->Excel Time\nmy $iBirth = LocaltimeExcel(11, 10, 12, 23, 2, 64);\n# = 1964-3-23 12:10:11\nprint $iBirth, \"\\n\";       # 23459.5070717593\n\n#Convert Excel Time -> localtime\nmy @aBirth = ExcelLocaltime($iBirth, undef);\nprint join(\":\", @aBirth), \"\\n\";   # 11:10:12:23:2:64:1:0\n\n#Formatting\nprint ExcelFmt('yyyy-mm-dd', $iBirth), \"\\n\"; #1964-3-23\nprint ExcelFmt('m-d-yy', $iBirth), \"\\n\";     # 3-23-64\nprint ExcelFmt('#,##0', $iBirth), \"\\n\";      # 23,460\nprint ExcelFmt('#,##0.00', $iBirth), \"\\n\";   # 23,459.51\nprint ExcelFmt('\"My Birthday is (m/d):\" m/d', $iBirth), \"\\n\";\n# My Birthday is (m/d): 3/23\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Spreadsheet::XLSX::Utility2007 exports utility functions concerned with Excel format setting.\n\nExcelFmt is used by Spreadsheet::XLSX::Fmt2007.pm which is used by Spreadsheet::XLSX.\n",
            "subsections": []
        },
        "Functions": {
            "content": "This module can export 3 functions: ExcelFmt, ExcelLocaltime and LocaltimeExcel.\n",
            "subsections": [
                {
                    "name": "ExcelFmt",
                    "content": "$sTxt = ExcelFmt($sFmt, $iData [, $i1904]);\n\n*$sFmt* is a format string for Excel. *$iData* is the target value. If *$flg1904* is true, this\nfunctions assumes that epoch is 1904. *$sTxt* is the result.\n\nFor more detail and examples, please refer sample/chkFmt.pl in this distribution.\n\nex.\n"
                },
                {
                    "name": "ExcelLocaltime",
                    "content": "($iSec, $iMin, $iHour, $iDay, $iMon, $iYear, $iwDay, $iMSec) = ExcelLocaltime($iExTime [,\n$flg1904]);\n\n*ExcelLocaltime* converts time information in Excel format into Perl localtime format.\n*$iExTime* is a time of Excel. If *$flg1904* is true, this functions assumes that epoch is 1904.\n*$iSec*, *$iMin*, *$iHour*, *$iDay*, *$iMon*, *$iYear*, *$iwDay* are same as localtime. *$iMSec*\nmeans 1/1,000,000 seconds(ms).\n"
                },
                {
                    "name": "LocaltimeExcel",
                    "content": "*$iExTime* = LocaltimeExcel($iSec, $iMin, $iHour, $iDay, $iMon, $iYear [,$iMSec] [,$flg1904])\n\n*LocaltimeExcel* converts time information in Perl localtime format into Excel format . *$iSec*,\n*$iMin*, *$iHour*, *$iDay*, *$iMon*, *$iYear* are same as localtime.\n\nIf *$flg1904* is true, this functions assumes that epoch is 1904. *$iExTime* is a time of Excel.\n\ncol2int\n*$iInt* = col2int($sCol);\n\nconverts a excel row letter into an int for use in an array\n\nThis function was contributed by Kevin Mulholland.\n\nint2col\n*$sCol* = int2col($iRow);\n\nconvert a column number into column letters NOET: This is quite a brute force coarse method does\nnot manage values over 701 (ZZ)\n\nThis function was contributed by Kevin Mulholland.\n\nsheetRef\n(*$iRow*, *$iCol*) = sheetRef($sStr);\n\nconvert an excel letter-number address into a useful array address NOTE: That also Excel uses\nX-Y notation, we normally use Y-X in arrays $sStr, excel coord (eg. A2).\n\nThis function was contributed by Kevin Mulholland.\n\nxls2csv\n$sCsvTxt = xls2csv($sFileName, $sRegion, $iRotate);\n\nconvert a chunk of an excel file into csv text chunk $sRegions = \"sheet-colrow:colrow\" (ex.\n'1-A1:B2' means 'A1:B2' for sheet 1) $iRotate = 0 or 1 (output should be rotated or not)\n\nThis function was contributed by Kevin Mulholland.\n"
                }
            ]
        },
        "AUTHOR": {
            "content": "Rob Polocz rob.polocz@trackvia.com based on work by for Spreadsheet::ParseExcel by Kawai\nTakanori (Hippo2000) used with permission\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Spreadsheet::ParseExcel, Spreadsheet::WriteExcel\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "This module is part of the Spreadsheet::XLSX distribution.\n",
            "subsections": []
        }
    },
    "summary": "Spreadsheet::XLSX::Utility2007 - Utility function for Spreadsheet::XLSX",
    "flags": [],
    "examples": [],
    "see_also": []
}