login time to lua (logged user objects)
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

login time to lua (logged user objects)

Started by UwV, 24 September, 2006, 01:29:18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

UwV

this one ..

" Changed: Result for !getinfo command + added login time. "
looks very nice :0)

and made me wonder if...
can we get that login time to lua ?
with the  logged user objects  or something maybe ?

thanks. ..
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

PPK

I don't know if lua have support for time in seconds from 1.1.1970, because in that it is stored in PtokaX  ::)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

UwV

calculate time (in seconds)  from : " time in seconds from 1.1.1970 "   to time now ?

i think i have actually seen that scripted somewhere before.. maybe a different date or even a variable date..

and if not it sure is possible to make a function for doing so..


.. thing is..  i see many scripts needing to store login times in tables to call them on timer or command..
for user uptime, session time, etc.  etc...
so i thought it could save scripters the tables and PX the memory ..

\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

Herodes

Quote from: UwV on 24 September, 2006, 13:33:44
calculate time (in seconds)  from : " time in seconds from 1.1.1970 "   to time now ?

i think i have actually seen that scripted somewhere before.. maybe a different date or even a variable date..

and if not it sure is possible to make a function for doing so..
From the Lua 5.1.x manual....

Quote from: The Lua 5.1 Manualos.time ( [ table ] )

Returns the current time when called without arguments, or a time representing the date and time specified by the given table. This table must have fields year, month, and day, and may have fields hour, min, sec, and isdst (for a description of these fields, see the os.date function).

The returned value is a number, whose meaning depends on your system. In POSIX, Windows, and some other systems, this number counts the number of seconds since some given start time (the "epoch"). In other systems, the meaning is not specified, and the number returned by time can be used only as an argument to date and difftime.

From what I recall it is as easy in Lua as easy it is in C++,...

SMF spam blocked by CleanTalk