Announcement

Collapse
No announcement yet.

Unixtime?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unixtime?

    I figure if you dont ask you don't get, so I'm asking... does anyone have a formula turning

    YYYY-MM-DD 00:00:00

    into a unix time?
    - BoKu -

  • #2
    Use os.time()

    Code:
    -- Date and time must be in a table
    local dt = {year=2010, month=08, day=12, hour=2, min=30, sec=20}
    -- Pass the table to os.time()
    local ut = os.time(dt)
    Dialog.Message("Unix Time", ut)
    Dermot

    I am so out of here :yes

    Comment


    • #3
      Originally posted by Dermot View Post
      Use os.time()

      Code:
      -- Date and time must be in a table
      local dt = {year=2010, month=08, day=12, hour=2, min=30, sec=20}
      -- Pass the table to os.time()
      local ut = os.time(dt)
      Dialog.Message("Unix Time", ut)
      Excellent, thanks Dermot!
      - BoKu -

      Comment


      • #4
        bump, does anyone have the formula to turn it back again, ie 1338436374 is Thu, 31 May 2012 03:52:54 GMT but 04:52:54 GMT+1 ??

        Comment


        • #5
          Unixtime is the quantity of seconds since 1.1.1970 00:00h.
          You just have to divide.

          Comment

          Working...
          X