[Plugin] CTime Library
#10

Quote:
Originally Posted by Gamer_Z
Посмотреть сообщение
any Unix-timestamp conversions available?
Plugin could come in handy though sometimes.. ;P
You can use "localtime" or "gmtime" (depending which you need) to convert timestamps to the tm structure. For example let's pick a random timestamp "254545645"
pawn Код:
new
    tm <tmStamp>
;
localtime(254545645, tmStamp);
   
static
    szStr[64]
;
strftime(szStr, sizeof(szStr), "%A %d %B %Y, %H:%M:%S", tmStamp); // Result: "Wednesday 25 January 1978, 04:07:25"
printf(szStr);
And to convert from tm structure to a timestamp use "mktime".

Quote:
Originally Posted by _[HuN]_Epsilon_
Посмотреть сообщение
linux?
I have no Linux installed right now. Will do it and post here when I'm done compiling.

If anyone else can compile to for Linux, please go ahead. And thanks for the comments.
Reply


Messages In This Thread
CTime Library - by RyDeR` - 30.10.2011, 23:15
Re: CTime Library - by iNorton - 30.10.2011, 23:23
Respuesta: CTime Library - by GantaIgarashi - 30.10.2011, 23:25
Re: CTime Library - by Kar - 30.10.2011, 23:26
Re: CTime Library - by Stigg - 30.10.2011, 23:26
Re: CTime Library - by GangsTa_ - 30.10.2011, 23:29
Re: CTime Library - by Scenario - 30.10.2011, 23:49
Re: CTime Library - by Gamer_Z - 31.10.2011, 06:11
Re: CTime Library - by SampEver1 - 31.10.2011, 06:17
Re: CTime Library - by RyDeR` - 31.10.2011, 07:27
Re: CTime Library - by Hugo1984 - 08.01.2012, 20:59
Re: CTime Library - by Scenario - 16.01.2012, 14:53
Respuesta: CTime Library - by [Nikk] - 16.01.2012, 22:10
AW: CTime Library - by Atrox95 - 11.04.2012, 19:38
Re: CTime Library - by steki. - 01.05.2012, 17:56
Re: CTime Library - by Ballu Miaa - 02.05.2012, 02:12
Re: CTime Library - by Pedrex - 12.07.2012, 02:47
Re: CTime Library - by Pedrex - 12.07.2012, 23:08
AW: CTime Library - by Meta - 15.07.2012, 18:06
Re: CTime Library - by Reboma - 17.07.2012, 09:27
Re: CTime Library - by xRotem - 22.08.2013, 21:55
Re: CTime Library - by TheArcher - 25.08.2013, 06:46
Re: CTime Library - by Admigo - 28.09.2013, 16:01
Re: CTime Library - by Mark™ - 28.09.2013, 20:27
Re: CTime Library - by Admigo - 29.09.2013, 07:32
Re: CTime Library - by xPlay - 01.10.2013, 06:25
Re: CTime Library - by Ballu Miaa - 24.01.2014, 02:08
Re: CTime Library - by Ballu Miaa - 24.01.2014, 13:02
Re: CTime Library - by Ballu Miaa - 25.01.2014, 06:33
Re: CTime Library - by AndreT - 20.02.2014, 17:38
Re: CTime Library - by Marricio - 28.07.2014, 01:49
Re: CTime Library - by Mark_Weston - 18.10.2014, 22:44
Re: CTime Library - by justice96 - 20.12.2014, 12:36
Re: CTime Library - by FinStar - 09.03.2015, 16:27
Re: CTime Library - by EmpireSk - 09.03.2015, 17:18
Re: CTime Library - by Kar - 28.04.2015, 23:43
Re: CTime Library - by delfino - 06.02.2016, 09:24
Re: CTime Library - by vannesenn - 16.06.2016, 10:15
Re: CTime Library - by Gigi-The-Beast - 16.06.2016, 11:38
Re: CTime Library - by vannesenn - 18.06.2016, 01:29

Forum Jump:


Users browsing this thread: 4 Guest(s)