Created
April 10, 2020 09:30
-
-
Save openroomxyz/86e53982b9f02915f3be1302cdcc585e to your computer and use it in GitHub Desktop.
Unity : How to get number of seconds since 1970 ( Epochtime ) ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static int GetCurrentTime() | |
| { | |
| System.DateTime epochStart = new System.DateTime(1970, 1, 1, 0, 0, 0, System.DateTimeKind.Utc); | |
| int cur_time = (int)(System.DateTime.UtcNow - epochStart).TotalSeconds; | |
| return cur_time; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment