Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Conversion from Unix Epoch Time
#2
Member function DateTime.FromUnix
Code:
Copy      Help
function long'time_t

;Initializes this variable from a C/Unix date/time - seconds since midnight January 1, 1970 UTC, aka C type time_t.

;REMARKS
;To store Unix time you can use a variable of type int or long. Use long to avoid the year 2038 problem.
;<link>https://en.wikipedia.org/wiki/Year_2038_problem</link>

;EXAMPLE
;DateTime t.FromUnix(0)
;out t.ToStr(4)
;out t.ToUnix


t=time_t*10000000+116444736000000000

Member function DateTime.ToUnix
Code:
Copy      Help
function'long

;Converts to C/Unix date/time - seconds since midnight January 1, 1970 UTC, aka C type time_t.

;REMARKS
;To store Unix time you can use a variable of type int or long. Use long to avoid the year 2038 problem.
;<link>https://en.wikipedia.org/wiki/Year_2038_problem</link>


ret t-116444736000000000/10000000


Messages In This Thread
Conversion from Unix Epoch Time - by stupomer - 05-06-2019, 06:11 PM
RE: Conversion from Unix Epoch Time - by Gintaras - 05-06-2019, 07:07 PM
RE: Conversion from Unix Epoch Time - by stupomer - 05-06-2019, 08:08 PM
RE: Conversion from Unix Epoch Time - by stupomer - 05-06-2019, 11:59 PM
RE: Conversion from Unix Epoch Time - by Gintaras - 05-07-2019, 04:58 AM
RE: Conversion from Unix Epoch Time - by stupomer - 05-07-2019, 05:38 AM

Forum Jump:


Users browsing this thread: 4 Guest(s)