title: Unix time to Humanreadable Date and Time
body: <p>Im working in lua with out date support so what are some ways th convert unix millisecond time to time and date</p>
  
  <p>mm/dd/yyyy hh:mm:ss</p>
  
  <p>i have the time and day but year and month are hard</p>
  
  <p>Thanks.</p>
  
  <p>EDIT: ALL I Need is Day of Month now I Figured out the other parts</p>
  
  <p>EDIT: the first part of code NO DAY OF MONTH and still working on DST</p>
  
  <pre><code>
   TIMEZONE=-5
   DAYLIGHTSAVING=0--NOT DONE
  
   while true do
    t=tick()
    y=math.floor(1970+ t /31556926)
    ds=((1970+t/31556926)-y)*31556926
    m=math.floor(ds/2629743)+1
    d=math.floor(ds/86400)+1
    md=0--NOT DONE
    wd=d%7+6
    print(md,wd)
    h=math.floor(math.fmod(t,60*60*24)/3600) + 5 + (TIMEZONE) + (DAYLIGHTSAVING)
    mn= math.floor(math.fmod(t,60*60*24)/60 - 60*h)
    s= math.floor(math.fmod(math.fmod(t,60*60*24),60))
    print(m,d,y)
    print(h,mn,s)
    wait(1)
   end
  </code>
  </pre>
  
  <p>i will make it nicer afer i get day of month and DST</p>