Star-Dust Expert Licensed User Longtime User Jun 20, 2021 #1 is correct? C#: static string unixTime() { DateTime foo = DateTime.UtcNow; long unixTime = ((DateTimeOffset)foo).ToUnixTimeMilliseconds(); return unixTime.ToString(); } To B4X B4X: Private Sub unixtime As String Return DateTime.Now End Sub Last edited: Jun 20, 2021
is correct? C#: static string unixTime() { DateTime foo = DateTime.UtcNow; long unixTime = ((DateTimeOffset)foo).ToUnixTimeMilliseconds(); return unixTime.ToString(); } To B4X B4X: Private Sub unixtime As String Return DateTime.Now End Sub
Erel B4X founder Staff member Licensed User Longtime User Jun 20, 2021 #2 DateTime.Now isn't the same as unix time. You should use DateUtils.ToUnixTime Upvote 0
Star-Dust Expert Licensed User Longtime User Jun 20, 2021 #3 Erel said: DateTime.Now isn't the same as unix time. You should use DateUtils.ToUnixTime Click to expand... Thank's Upvote 0
Erel said: DateTime.Now isn't the same as unix time. You should use DateUtils.ToUnixTime Click to expand... Thank's