[GB.UTIL]

* NEW: Compute Date.ToUnixTime() with System.TimeZone.


git-svn-id: svn://localhost/gambas/trunk@8133 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2017-05-03 23:56:25 +00:00
parent 0dce432dfe
commit ec834b36a3
2 changed files with 7 additions and 2 deletions

View file

@ -6,7 +6,7 @@ Private $aMonth As String[]
Public Sub ToUnixTime({Date} As Date) As Long
Return DateDiff(Date(1970, 1, 1), {Date} - Frac(Date(Now)), gb.Second)
Return DateDiff(Date(1970, 1, 1), {Date}, gb.Second) + System.TimeZone
End

View file

@ -2,6 +2,11 @@
Public Sub Main()
Print Date.ToRFC822(Date.FromRFC822("23 Apr 17 19:55:10 +0200"), "-0100")
'Print Date.ToRFC822(Date.FromRFC822("23 Apr 17 19:55:10 +0200"), "-0100")
Dim sEpochSeconds As String
Shell "date +%s" To sEpochSeconds
Print Trim(sEpochSeconds)
Print Date.ToUnixTime(Now)
End