This repository has been archived by the owner on Sep 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_Time.au3
37 lines (34 loc) · 1.95 KB
/
_Time.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include-once
#include <Date.au3>
#include <String.au3>
#cs Function List
_Time_FullGTM() - Czas GTM
_Time() - Czas w sekundach
#ce Function List
; #INDEX# =======================================================================================================================
; Title .........: Czas GTM
; Description ...: Zwraca czas w GTM np. Sat, 09 Sep 2018 08:36:05 GMT
; Author(s) .....: Krzysztof Żyłka
; ===============================================================================================================================
Func _Time_FullGTM()
Local $mon[] = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
Local $day[] = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fir", "Sat"]
Local $tLocal = _Date_Time_GetLocalTime()
Local $tSystem = _Date_Time_TzSpecificLocalTimeToSystemTime(DllStructGetPtr($tLocal))
Local $data = _StringExplode(_Date_Time_SystemTimeToDateTimeStr($tSystem), " ")
Local $date = _StringExplode($data[0], "/")
Local $wday = _DateToDayOfWeek($date[2], $date[0], $date[1])
Return $day[Int($wday) - 1] & ", " & $date[1] & " " & $mon[Int($date[0])] & " " & $date[2] & " " & $data[1] & " GMT"
EndFunc ;==>_Time_FullGTM
; #INDEX# =======================================================================================================================
; Title .........: Czas w sekundach
; Description ...: Zwraca czas w sekundach (od 01/01/1970 00:00:00)
; Author(s) .....: Krzysztof Żyłka
; ===============================================================================================================================
Func _Time()
Local $tLocal = _Date_Time_GetLocalTime()
Local $tSystem = _Date_Time_TzSpecificLocalTimeToSystemTime(DllStructGetPtr($tLocal))
Local $data = _StringExplode(_Date_Time_SystemTimeToDateTimeStr($tSystem), " ")
Local $date = _StringExplode($data[0], "/")
Return _DateDiff('s', '1970/01/01 00:00:00', $date[2] & '/' & $date[0] & '/' & $date[1] & ' ' & $data[1])
EndFunc ;==>_Time