Equivalent of gmtime in Julia?
Question: Julia has `strftime` as a built-in but not `gmtime`.

    
    
    julia> strftime
    strftime (generic function with 3 methods)
    
    julia> gmtime
    ERROR: gmtime not defined
    

What is the preferred Julia way to do the equivalent of `gmtime`? The idea is
to turn seconds since the epoch into a time structure in the Z (+00:00) time
zone. Here in Los Angeles, I see:

    
    
    julia> strftime("%H:%M:%S", 0)
    "16:00:00"
    

I would like to see `"00:00:00"`. I can do it in Python:

    
    
    >>> from time import strftime, gmtime
    >>> strftime("%H:%M:%S", gmtime(0))
    '00:00:00'
    

I tried to use `ccall` in Julia but it did not work

    
    
    julia> ccall( (:gmtime, "libc"), TmStruct, (Int64,), 0)
    TmStruct(1590498096,32767,16041550,1,-1924564896,32744,1,0,0,0,0,0,1590498144,32767)
    
    julia> strftime("%H:%M:%S", ans)
    "16041550:32767:1590498096"
    

What went wrong with my `ccall`? And better, is there just a nicer all-Julia
way to get the effect of `gmtime`?


Answer: Looks like `gmtime` is on Julia's
[**TODO**](https://github.com/JuliaLang/julia/blob/master/base/libc.jl#L30)
list. Until it gets included, will something like this work for you?

    
    
    julia> function gmtime(t::Real)
               t = floor(t)
               tm = TmStruct()
               ccall(:gmtime_r, Ptr{TmStruct}, (Ptr{Int}, Ptr{TmStruct}), &t, &tm)
               return tm
           end
    gmtime (generic function with 1 method)
    
    julia> strftime("%H:%M:%S", gmtime(0))
    "00:00:00"
    

