如何得到这样的时间格式
本帖最后由 hanyueye511 于 2012-10-9 14:53 编辑取系统时间是2012/10/09 12:10:00,如何转化成2012-10-09_12-10-00格式 回复 1# hanyueye511
MsgBox(0,0,@YEAR&'-'&@MON&'-'&@MDAY&'_'&@HOUR&'-'&@MIN&'-'&@SEC)
$timestr = "2012/10/09 12:10:00"
$timestr = StringReplace($timestr, "/", "-")
$timestr = StringReplace($timestr, Chr(0x20), "_")
$timestr = StringReplace($timestr, ":", "-")
MsgBox(0, "", $timestr)
我也来凑热闹
MsgBox(0,0,StringFormat("%04d-%02d-%02d_%02d-%02d-%02d\n",@YEAR,@mon,@MDAY,@HOUR,@min,@SEC)) 都是高手啊。 犀利,我就围观一下吧 学习了,方法很多啊! 本帖最后由 netegg 于 2012-10-18 23:56 编辑
#include <date.au3>
msgbox(0,0,StringReplace(StringRegExpReplace(_NowCalc(), '/|:', '-'), ' ','_'))
#Include <WinAPIEx.au3>
MsgBox('', 'NOW', _WinAPI_GetDateFormat(0,0,0,'yyyy-MM-dd')&'_'& _WinAPI_GetTimeFormat(0, 0, 0, 'HH-mm-ss'))
页:
[1]