• windows下用时间戳创建文件名


    英文环境下:

    echo Archive_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.zip

    中文:

    1. echo 根据当前日期时间,生成文件名称,......  
    2. set YYYYmmdd=%date:~0,4%%date:~5,2%%date:~8,2%  
    3. set hhmiss=%time:~0,2%%time:~3,2%%time:~6,2%  
    4. set "filename=WebSite3copy%YYYYmmdd%_%hhmiss%.zip"  
    5. echo %filename% 

    去掉空格的方式:

    1. c:>set h=%time:~0,2%
    2. c:>set h=%h: =0%
    3. c:>echo %date:~0,4%%date:~5,2%%date:~8,2%%h%%time:~3,2%%time:~6,2%
    4. 20150324090254 

    参考的链接: http://blog.csdn.net/chinadm123/article/details/44588891

    http://blog.csdn.net/xuexiaodong009/article/details/53462592

    https://stackoverflow.com/questions/7727114/batch-command-date-and-time-in-file-name

    我的备份mantis的脚本:

    cd C:Program FilesMySQLMySQL Server 5.6in

    set h=%time:~0,2%
    set h=%h: =0%
    set "filename=Mantis_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.sql"
    echo %filename%

    mysqldump -uroot -p3edc$RFV bugtracker > \172.16.10.240Infa_SharedMantis\%filename%

  • 相关阅读:
    [YTU]_2917(Shape系列-3)
    c3p0-0.9.2.1.bin用于jdbc链接池
    C#加密解密DES字符串<转>
    Bechmarksql
    PHP中foreach有关引用的问题
    jqgrid 原理2
    jqggrid原理2
    jqgrid1原理
    JQgrid 入门
    搞开发真的是 坑太多了,
  • 原文地址:https://www.cnblogs.com/zwingblog/p/8027318.html
Copyright © 2020-2023  润新知