diff --git a/comp/src/gb.util/.src/Date.module b/comp/src/gb.util/.src/Date.module index c88537441..ddfc4092a 100644 --- a/comp/src/gb.util/.src/Date.module +++ b/comp/src/gb.util/.src/Date.module @@ -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 diff --git a/comp/src/gb.util/.src/MMain.module b/comp/src/gb.util/.src/MMain.module index c803f8892..d5d3e72d4 100644 --- a/comp/src/gb.util/.src/MMain.module +++ b/comp/src/gb.util/.src/MMain.module @@ -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