返回【Tue Jun 24 08:43:05 UTC+0800 2014】 格式日期时间
因写程序时有这需求时所写,方便调用
;一般用于日期的显示 特别是用于某些post/get数据时,时间的提交
;~返回的日期格式 Tue Jun 24 08:43:05 UTC+0800 2014
-
```Global Const $xinqi[8] = [7, "Sun ", "Mon ", "Tue ", "Wed ", "Thu ", "Fri ", "Sat "] ;星期 0 - 6
Global Const $yue[13] = [12, "Jan ", "Feb ", "Mar ", "Apr ", "May ", "Jun ", "Jul ", "Aug ", "Sep ", "Oct ", "Nov ", "Dec "] ;月分 1 - 12
;~ MsgBox(0,"示例",JY_UTC_Dtime())
;by绿色风 2014.06.24
;[url]www.JianYiIT.com[/url] 接脚本活联系QQ:79664738
;一般用于日期的显示 特别是用于某些post/get数据时,时间的提交
;~返回的日期格式 Tue Jun 24 08:43:05 UTC+0800 2014
Func JY_UTC_Dtime()
Return $xinqi[@WDAY] & $yue[@MON] & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & " UTC+0800 " & @YEAR
EndFunc```
附另一写作方法:
```#include <WinAPIex.au3>
#include <Date.au3>
Local $aInfo = _Date_Time_GetTimeZoneInformation()
Local $bias = 'UTC' & (($aInfo[1] / $aInfo[7]> 0) ? '+' : '') & $aInfo[1] / $aInfo[7]
$iWeekday = _DateToDayOfWeek(@YEAR, @MON, @MDAY)
MsgBox(0, 0, _DateDayOfWeek($iWeekday) & ' ' & _DateToMonth(_WinAPI_GetDateFormat(0, 0, 0, 'M'), 1) & ' ' & _WinAPI_GetDateFormat(0, 0, 0, 'dd') & ' ' & _WinAPI_GetTimeFormat() & ' ' & $bias & ' ' & _WinAPI_GetDateFormat(0, 0, 0, 'yyyy'))```
```
本文固定链接: http://jianyiit.com/post-22.html
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!