ULX

Author Topic: Ban Time "Conversion"  (Read 1737 times)

0 Members and 1 Guest are viewing this topic.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Ban Time "Conversion"
« on: June 15, 2013, 02:27:04 PM »
Hey.

I would like to know how to "convert" the ban times in data/ulib/bans.txt into time and date.
If you don't understand what I mean, is like this example:
Code: [Select]
"STEAM_:0:0:12345678"
{
"unban" "1371874111"
"time" "1371269311"
"reason" "Reason"
"admin" "Name(STEAM_0:0:87654321)"
}

What I would like to "convert" to time and date is what is after "unban" and "time". It would make my job easier to look through logs and check the time he got banned and what for (since we usually don't ban with descriptive reasons).
It's not really a huge deal, but it would help me out a lot to get it to a normal time. And to reference, the "unban" and "time" in the "code" section is taken from a real ban we had quite recently.

Thanks in advance,
Decicus.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Ban Time "Conversion"
« Reply #1 on: June 15, 2013, 04:15:28 PM »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Ban Time "Conversion"
« Reply #2 on: June 15, 2013, 09:02:21 PM »
And just so you and anyone else know Decicus, most programming languages, lua included, use a Unix epoch time.
Seconds since midnight Jan 1 1970
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Ban Time "Conversion"
« Reply #3 on: June 16, 2013, 04:51:34 AM »
I'm not really a coder, so I didn't know.

Thanks a lot for the help!
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.