在不同日期格式下批处理输出自定义格式的日期和时间

在Windows系统中有不同的语言版本和时区设置。有时,由于业务的需求,我们需要生成“年月日”格式的日期格式目录,然后在该目录中生成时间格式的文件,用来记录系统当前时间的日志信息。

系统日期有yy-mm-dd,mm-dd-yy以及dd-mm-yy三种格式,这样导致了使用的不方便。下面介绍几种实现方法:

  1. 有 人通过预先修改windows注册表将日期改成yy-mm-dd格式然后通过发出命令:c:\> echo %date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%这种该注册表的方法显然不是很可取。
  2. 还有人通过vbs来实现,制作成批处理文件内容如下:@echo off
    echo wscript.echo year(date) ^& right(”0″ ^& month(date),2) ^& right(”0″ ^& day(date),2) ^& right(”0″ ^& hour(time),2) ^& right(”0″ ^& minute(time),2)>%tmp%\temp1.vbs
    cscript /nologo %tmp%\temp1.vbs
    del %tmp%\temp1.vbs 

    这种使用script的方式也不是很好。

  3. 我认为最好的方式是,通过批处理中的for语句进行系统日期格式的判断,然后进行处理。批处理文件内容如下:

@ECHO OFF

ECHO. |DATE > temp1
FOR /F “eol=T tokens=5 delims=() ” %%i in (temp1) do set date_format=%%i
FOR /F “eol=E tokens=5,6,7,8 delims=/- ” %%a in (temp1) do (
    IF /I %date_format% EQU mm-dd-yy ( set month=%%a
                                       set day=%%b
                                       set year=%%c
                                       set week=%%d )
    IF /I %date_format% EQU dd-mm-yy ( set day=%%a
                                       set month=%%b
                                       set year=%%c
                                       set week=%%d )
    IF /I %date_format% EQU yy-mm-dd ( set year=%%a
                                       set month=%%b
                                       set day=%%c
                                       set week=%%d )      )

ECHO. |TIME > temp2
FOR /F “eol=E tokens=5-8 delims=:. ” %%A in (temp2) do ( set hour=%%A
                                                         set minute=%%B
                                                         set second=%%C
                                                         set hundredth=%%D )
                                                        
REM TIME format 08:10:00 PM, it means 20:10:00
REM IF %meridiem% EQU PM SET /A %%hour%%=%%hour%%+12

SET current_date=%year%%month%%day%
SET current_time=%hour%%minute%%second%%hundredth%

IF EXIST temp1 DEL /Q temp1
IF EXIST temp2 DEL /Q temp2

ECHO Current date = %current_date%
ECHO Current time = %current_time%

MKDIR %current_date%
ECHO. > %current_date%\%current_time%.log

Last modified onSunday, 14 October 2012 04:07

( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169
Call Stack
#TimeMemoryFunctionLocation
10.0003399752{main}( ).../index.php:0
20.04651352704Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.04651352704Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.15272797200Joomla\CMS\Application\SiteApplication->dispatch( $component = ??? ).../SiteApplication.php:233
50.15312823664Joomla\CMS\Component\ComponentHelper::renderComponent( $option = 'com_k2', $params = ??? ).../SiteApplication.php:194
60.15362879016Joomla\CMS\Component\ComponentHelper::executeComponent( $path = '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:377
70.15362896072require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php ).../ComponentHelper.php:402
80.15743030744K2ControllerItem->execute( $task = '' ).../k2.php:64
90.15743030744K2ControllerItem->display( $cachable = ???, $urlparams = ??? ).../BaseController.php:710
100.15983053992K2ControllerItem->display( $cachable = TRUE, $urlparams = ['id' => 'INT', 'print' => 'INT', 'lang' => 'CMD', 'Itemid' => 'INT', 'm' => 'INT', 'amp' => 'INT', 'tmpl' => 'CMD', 'template' => 'CMD'] ).../item.php:78
110.15983053992K2ControllerItem->display( $cachable = TRUE, $urlparams = ['id' => 'INT', 'print' => 'INT', 'lang' => 'CMD', 'Itemid' => 'INT', 'm' => 'INT', 'amp' => 'INT', 'tmpl' => 'CMD', 'template' => 'CMD'] ).../controller.php:19
120.16043061128Joomla\CMS\Cache\Controller\ViewController->get( $view = class K2ViewItem { public $document = class Joomla\CMS\Document\HtmlDocument { public $_links = [...]; public $_custom = [...]; public $template = NULL; public $baseurl = NULL; public $params = NULL; public $_file = NULL; protected $_template = ''; protected $_template_tags = [...]; protected $_caching = NULL; private $_html5 = NULL; public $title = '在不同日期格式下批处理输出自定义格式的日期和时间'; public $description = '在Windows系统中有不同的语言版本和时区设置。有时,由于业务的需求,我们需要生成“年月日”格式的日期格式目录,然后在该目录中生成时间格式的文件,用来记录系统当前时间的日志信息。 系统日期有yy-mm-dd,mm-dd-yy以及dd-mm-yy三种格式,这样导致了使用的不方便。下面介绍几种实现方法...'; public $link = ''; public $base = 'https://www.shan.info/item/284-%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%'; public $language = 'en-gb'; public $direction = 'ltr'; public $_generator = 'Joomla! - Open Source Content Management'; public $_mdate = ''; public $_tab = '\t'; public $_lineEnd = '\n'; public $_charset = 'utf-8'; public $_mime = 'text/html'; public $_namespace = ''; public $_profile = ''; public $_scripts = [...]; public $_script = [...]; protected $scriptOptions = [...]; public $_styleSheets = [...]; public $_style = [...]; public $_metaTags = [...]; public $_engine = NULL; public $_type = 'html'; protected $mediaVersion = '15dbf078d61dbbf76811992dd0143dd9' }; protected $_name = 'item'; protected $_models = ['itemlist' => class K2ModelItemlist { ... }, 'item' => class K2ModelItem { ... }]; protected $_basePath = '/var/www/vhosts/shan.info/httpdocs/components/com_k2'; protected $_defaultModel = 'item'; protected $_layout = 'item'; protected $_layoutExt = 'php'; protected $_layoutTemplate = '_'; protected $_path = ['template' => [...], 'helper' => [...]]; protected $_template = '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php'; protected $_output = NULL; protected $_escape = 'htmlspecialchars'; protected $_charset = 'UTF-8'; protected $_errors = []; public $baseurl = ''; public $addLink = NULL; public $inlineCommentsModeration = FALSE; public $item = class stdClass { public $id = '284'; public $title = '在不同日期格式下批处理输出自定义格式的日期和时间'; public $alias = '在不同日期格式下批处理输出自定义格式的日期和时间'; public $catid = '39'; public $published = '1'; public $introtext = '<p>在Windows系统中有不同的语言版本和时区设置。有时,由于业务的需求,我们需要生成“年月日”格式的日期格式目录,然后在该目录中生成时间格式的文件,用来记录系统当前时间的日志信息。</p>\r\n<p>系统日期有yy-mm-dd,mm-dd-yy以及dd-mm-yy三种格式,这样导致了使用的不方便。下面介绍几种实现方法:</p>\r\n<ol>\r\n<li>有 人通过预先修改windows注册表将日期改成yy-mm-dd格式然后通过发出'; public $fulltext = ''; public $video = NULL; public $gallery = NULL; public $extra_fields = NULL; public $extra_fields_search = ''; public $created = '2012-06-13 11:49:46'; public $created_by = '63'; public $created_by_alias = ''; public $checked_out = '0'; public $checked_out_time = '0000-00-00 00:00:00'; public $modified = '2012-10-14 02:07:15'; public $modified_by = '0'; public $publish_up = '2012-06-13 11:49:15'; public $publish_down = '0000-00-00 00:00:00'; public $trash = '0'; public $access = '1'; public $ordering = '1'; public $featured = '0'; public $featured_ordering = '0'; public $image_caption = ''; public $image_credits = ''; public $video_caption = ''; public $video_credits = ''; public $hits = '2859'; public $params = class Joomla\Registry\Registry { ... }; public $metadesc = ''; public $metadata = ''; public $metakey = ''; public $plugins = ''; public $language = '*'; public $category = class TableK2Category { ... }; public $link = '/item/284-在不同日期格式下批处理输出自定义格式的日期和时间.html'; public $printLink = '/item/284-在不同日期格式下批处理输出自定义格式的日期和时间.html?tmpl=component&amp;print=1'; public $tags = [...]; public $imageXSmall = ''; public $imageSmall = ''; public $imageMedium = ''; public $imageLarge = ''; public $imageXLarge = ''; public $attachments = [...]; public $rawTitle = '在不同日期格式下批处理输出自定义格式的日期和时间'; public $author = class Joomla\CMS\User\User { ... }; public $videoType = 'allvideos'; public $text = '<p>在Windows系统中有不同的语言版本和时区设置。有时,由于业务的需求,我们需要生成“年月日”格式的日期格式目录,然后在该目录中生成时间格式的文件,用来记录系统当前时间的日志信息。</p>\r\n<p>系统日期有yy-mm-dd,mm-dd-yy以及dd-mm-yy三种格式,这样导致了使用的不方便。下面介绍几种实现方法:</p>\r\n<ol>\r\n<li>有 人通过预先修改windows注册表将日期改成yy-mm-dd格式然后通过发出'; public $event = class stdClass { ... }; public $jcfields = [...]; public $image = ''; public $imageWidth = '600'; public $comments = [...]; public $numOfComments = 0; public $nextLink = '/item/265-in-place-upgrade-from-windows-server-web-to-standard.html'; public $nextTitle = 'In-place upgrade from Windows Server WEB to Standard'; public $nextImageXSmall = ''; public $nextImageSmall = ''; public $nextImageMedium = ''; public $nextImageLarge = ''; public $nextImageXLarge = ''; public $previousLink = '/item/361-英特尔rst服务未在运行-2008-r2.html'; public $previousTitle = '英特尔RST服务未在运行 2008 r2'; public $previousImageXSmall = ''; public $previousImageSmall = ''; public $previousImageMedium = ''; public $previousImageLarge = ''; public $previousImageXLarge = ''; public $absoluteURL = 'https://www.shan.info/item/284-%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%'; public $langTagForFB = 'en_GB'; public $langTagForTW = 'en-gb'; public $langTagForLI = 'en_GB'; public $sharinglink = 'https://www.shan.info/item/284-%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%'; public $socialLink = 'https%3A%2F%2Fwww.shan.info%2Fitem%2F284-%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%'; public $twitterURL = 'https://twitter.com/intent/tweet?text=%E5%9C%A8%E4%B8%8D%E5%90%8C%E6%97%A5%E6%9C%9F%E6%A0%BC%E5%BC%8F%E4%B8%8B%E6%89%B9%E5%A4%84%E7%90%86%E8%BE%93%E5%87%BA%E8%87%AA%E5%AE%9A%E4%B9%89%E6%A0%BC%E5%BC%8F%E7%9A%84%E6%97%A5%E6%9C%9F%E5%92%8C%E6%97%B6%E9%97%B4&amp;url=https%3A%2F%2Fwww.shan.info%2Fitem%2F284-%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25'; public $langTagForGP = ''; public $emailLink = '/component/mailto/?tmpl=component&amp;template=gk_publisher&amp;link=fb29e13aea5d831529645c23849887a9e0af0cea' }; public $user = class Joomla\CMS\User\User { protected $isRoot = FALSE; public $id = 0; public $name = NULL; public $username = NULL; public $email = NULL; public $password = NULL; public $password_clear = ''; public $block = NULL; public $sendEmail = 0; public $registerDate = NULL; public $lastvisitDate = NULL; public $activation = NULL; public $params = NULL; public $groups = [...]; public $guest = 1; public $lastResetTime = NULL; public $resetCount = NULL; public $requireReset = NULL; protected $_params = class Joomla\Registry\Registry { ... }; protected $_authGroups = NULL; protected $_authLevels = [...]; protected $_authActions = NULL; protected $_errorMsg = NULL; protected $userHelper = class Joomla\CMS\User\UserWrapper { ... }; protected $_errors = [...]; public $aid = 0; public $gid = 1 }; public $params = class Joomla\Registry\Registry { protected $data = class stdClass { ... }; protected $initialized = TRUE; public $separator = '.' }; public $pagination = class Joomla\CMS\Pagination\Pagination { public $limitstart = 0; public $limit = 10; public $total = 0; public $prefix = ''; public $pagesStart = 1; public $pagesStop = 0; public $pagesCurrent = 1; public $pagesTotal = 0; public $hideEmptyLimitstart = FALSE; protected $viewall = FALSE; protected $additionalUrlParams = [...]; protected $app = class Joomla\CMS\Application\SiteApplication { ... }; protected $data = NULL } }, $method = 'display', $id = ???, $wrkarounds = ??? ).../BaseController.php:663
130.16093081496K2ViewItem->display( $tpl = ??? ).../ViewController.php:102
140.20076008528K2ViewItem->display( $tpl = NULL ).../view.html.php:742
150.20076008528K2ViewItem->loadTemplate( $tpl = NULL ).../HtmlView.php:230
160.20186210600include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php ).../HtmlView.php:701

( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478
Call Stack
#TimeMemoryFunctionLocation
10.0003399752{main}( ).../index.php:0
20.04651352704Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.04651352704Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.15272797200Joomla\CMS\Application\SiteApplication->dispatch( $component = ??? ).../SiteApplication.php:233
50.15312823664Joomla\CMS\Component\ComponentHelper::renderComponent( $option = 'com_k2', $params = ??? ).../SiteApplication.php:194
60.15362879016Joomla\CMS\Component\ComponentHelper::executeComponent( $path = '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:377
70.15362896072require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php ).../ComponentHelper.php:402
80.15743030744K2ControllerItem->execute( $task = '' ).../k2.php:64
90.15743030744K2ControllerItem->display( $cachable = ???, $urlparams = ??? ).../BaseController.php:710
100.15983053992K2ControllerItem->display( $cachable = TRUE, $urlparams = ['id' => 'INT', 'print' => 'INT', 'lang' => 'CMD', 'Itemid' => 'INT', 'm' => 'INT', 'amp' => 'INT', 'tmpl' => 'CMD', 'template' => 'CMD'] ).../item.php:78
110.15983053992K2ControllerItem->display( $cachable = TRUE, $urlparams = ['id' => 'INT', 'print' => 'INT', 'lang' => 'CMD', 'Itemid' => 'INT', 'm' => 'INT', 'amp' => 'INT', 'tmpl' => 'CMD', 'template' => 'CMD'] ).../controller.php:19
120.16043061128Joomla\CMS\Cache\Controller\ViewController->get( $view = class K2ViewItem { public $document = class Joomla\CMS\Document\HtmlDocument { public $_links = [...]; public $_custom = [...]; public $template = NULL; public $baseurl = NULL; public $params = NULL; public $_file = NULL; protected $_template = ''; protected $_template_tags = [...]; protected $_caching = NULL; private $_html5 = NULL; public $title = '在不同日期格式下批处理输出自定义格式的日期和时间'; public $description = '在Windows系统中有不同的语言版本和时区设置。有时,由于业务的需求,我们需要生成“年月日”格式的日期格式目录,然后在该目录中生成时间格式的文件,用来记录系统当前时间的日志信息。 系统日期有yy-mm-dd,mm-dd-yy以及dd-mm-yy三种格式,这样导致了使用的不方便。下面介绍几种实现方法...'; public $link = ''; public $base = 'https://www.shan.info/item/284-%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%'; public $language = 'en-gb'; public $direction = 'ltr'; public $_generator = 'Joomla! - Open Source Content Management'; public $_mdate = ''; public $_tab = '\t'; public $_lineEnd = '\n'; public $_charset = 'utf-8'; public $_mime = 'text/html'; public $_namespace = ''; public $_profile = ''; public $_scripts = [...]; public $_script = [...]; protected $scriptOptions = [...]; public $_styleSheets = [...]; public $_style = [...]; public $_metaTags = [...]; public $_engine = NULL; public $_type = 'html'; protected $mediaVersion = '15dbf078d61dbbf76811992dd0143dd9' }; protected $_name = 'item'; protected $_models = ['itemlist' => class K2ModelItemlist { ... }, 'item' => class K2ModelItem { ... }]; protected $_basePath = '/var/www/vhosts/shan.info/httpdocs/components/com_k2'; protected $_defaultModel = 'item'; protected $_layout = 'item'; protected $_layoutExt = 'php'; protected $_layoutTemplate = '_'; protected $_path = ['template' => [...], 'helper' => [...]]; protected $_template = '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php'; protected $_output = NULL; protected $_escape = 'htmlspecialchars'; protected $_charset = 'UTF-8'; protected $_errors = []; public $baseurl = ''; public $addLink = NULL; public $inlineCommentsModeration = FALSE; public $item = class stdClass { public $id = '284'; public $title = '在不同日期格式下批处理输出自定义格式的日期和时间'; public $alias = '在不同日期格式下批处理输出自定义格式的日期和时间'; public $catid = '39'; public $published = '1'; public $introtext = '<p>在Windows系统中有不同的语言版本和时区设置。有时,由于业务的需求,我们需要生成“年月日”格式的日期格式目录,然后在该目录中生成时间格式的文件,用来记录系统当前时间的日志信息。</p>\r\n<p>系统日期有yy-mm-dd,mm-dd-yy以及dd-mm-yy三种格式,这样导致了使用的不方便。下面介绍几种实现方法:</p>\r\n<ol>\r\n<li>有 人通过预先修改windows注册表将日期改成yy-mm-dd格式然后通过发出'; public $fulltext = ''; public $video = NULL; public $gallery = NULL; public $extra_fields = NULL; public $extra_fields_search = ''; public $created = '2012-06-13 11:49:46'; public $created_by = '63'; public $created_by_alias = ''; public $checked_out = '0'; public $checked_out_time = '0000-00-00 00:00:00'; public $modified = '2012-10-14 02:07:15'; public $modified_by = '0'; public $publish_up = '2012-06-13 11:49:15'; public $publish_down = '0000-00-00 00:00:00'; public $trash = '0'; public $access = '1'; public $ordering = '1'; public $featured = '0'; public $featured_ordering = '0'; public $image_caption = ''; public $image_credits = ''; public $video_caption = ''; public $video_credits = ''; public $hits = '2859'; public $params = class Joomla\Registry\Registry { ... }; public $metadesc = ''; public $metadata = ''; public $metakey = ''; public $plugins = ''; public $language = '*'; public $category = class TableK2Category { ... }; public $link = '/item/284-在不同日期格式下批处理输出自定义格式的日期和时间.html'; public $printLink = '/item/284-在不同日期格式下批处理输出自定义格式的日期和时间.html?tmpl=component&amp;print=1'; public $tags = [...]; public $imageXSmall = ''; public $imageSmall = ''; public $imageMedium = ''; public $imageLarge = ''; public $imageXLarge = ''; public $attachments = [...]; public $rawTitle = '在不同日期格式下批处理输出自定义格式的日期和时间'; public $author = class Joomla\CMS\User\User { ... }; public $videoType = 'allvideos'; public $text = '<p>在Windows系统中有不同的语言版本和时区设置。有时,由于业务的需求,我们需要生成“年月日”格式的日期格式目录,然后在该目录中生成时间格式的文件,用来记录系统当前时间的日志信息。</p>\r\n<p>系统日期有yy-mm-dd,mm-dd-yy以及dd-mm-yy三种格式,这样导致了使用的不方便。下面介绍几种实现方法:</p>\r\n<ol>\r\n<li>有 人通过预先修改windows注册表将日期改成yy-mm-dd格式然后通过发出'; public $event = class stdClass { ... }; public $jcfields = [...]; public $image = ''; public $imageWidth = '600'; public $comments = [...]; public $numOfComments = 0; public $nextLink = '/item/265-in-place-upgrade-from-windows-server-web-to-standard.html'; public $nextTitle = 'In-place upgrade from Windows Server WEB to Standard'; public $nextImageXSmall = ''; public $nextImageSmall = ''; public $nextImageMedium = ''; public $nextImageLarge = ''; public $nextImageXLarge = ''; public $previousLink = '/item/361-英特尔rst服务未在运行-2008-r2.html'; public $previousTitle = '英特尔RST服务未在运行 2008 r2'; public $previousImageXSmall = ''; public $previousImageSmall = ''; public $previousImageMedium = ''; public $previousImageLarge = ''; public $previousImageXLarge = ''; public $absoluteURL = 'https://www.shan.info/item/284-%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%'; public $langTagForFB = 'en_GB'; public $langTagForTW = 'en-gb'; public $langTagForLI = 'en_GB'; public $sharinglink = 'https://www.shan.info/item/284-%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%'; public $socialLink = 'https%3A%2F%2Fwww.shan.info%2Fitem%2F284-%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%'; public $twitterURL = 'https://twitter.com/intent/tweet?text=%E5%9C%A8%E4%B8%8D%E5%90%8C%E6%97%A5%E6%9C%9F%E6%A0%BC%E5%BC%8F%E4%B8%8B%E6%89%B9%E5%A4%84%E7%90%86%E8%BE%93%E5%87%BA%E8%87%AA%E5%AE%9A%E4%B9%89%E6%A0%BC%E5%BC%8F%E7%9A%84%E6%97%A5%E6%9C%9F%E5%92%8C%E6%97%B6%E9%97%B4&amp;url=https%3A%2F%2Fwww.shan.info%2Fitem%2F284-%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25BD%25EF%25BF%25'; public $langTagForGP = ''; public $emailLink = '/component/mailto/?tmpl=component&amp;template=gk_publisher&amp;link=fb29e13aea5d831529645c23849887a9e0af0cea' }; public $user = class Joomla\CMS\User\User { protected $isRoot = FALSE; public $id = 0; public $name = NULL; public $username = NULL; public $email = NULL; public $password = NULL; public $password_clear = ''; public $block = NULL; public $sendEmail = 0; public $registerDate = NULL; public $lastvisitDate = NULL; public $activation = NULL; public $params = NULL; public $groups = [...]; public $guest = 1; public $lastResetTime = NULL; public $resetCount = NULL; public $requireReset = NULL; protected $_params = class Joomla\Registry\Registry { ... }; protected $_authGroups = NULL; protected $_authLevels = [...]; protected $_authActions = NULL; protected $_errorMsg = NULL; protected $userHelper = class Joomla\CMS\User\UserWrapper { ... }; protected $_errors = [...]; public $aid = 0; public $gid = 1 }; public $params = class Joomla\Registry\Registry { protected $data = class stdClass { ... }; protected $initialized = TRUE; public $separator = '.' }; public $pagination = class Joomla\CMS\Pagination\Pagination { public $limitstart = 0; public $limit = 10; public $total = 0; public $prefix = ''; public $pagesStart = 1; public $pagesStop = 0; public $pagesCurrent = 1; public $pagesTotal = 0; public $hideEmptyLimitstart = FALSE; protected $viewall = FALSE; protected $additionalUrlParams = [...]; protected $app = class Joomla\CMS\Application\SiteApplication { ... }; protected $data = NULL } }, $method = 'display', $id = ???, $wrkarounds = ??? ).../BaseController.php:663
130.16093081496K2ViewItem->display( $tpl = ??? ).../ViewController.php:102
140.20076008528K2ViewItem->display( $tpl = NULL ).../view.html.php:742
150.20076008528K2ViewItem->loadTemplate( $tpl = NULL ).../HtmlView.php:230
160.20186210600include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php ).../HtmlView.php:701
back to top