Jump to content

[HELP] getRealTime problem


..:D&G:..

Recommended Posts

Posted

So I use this getRealTime function to get the date and time when the player logs in, but it returns some weird date: 28-2-116 21:21:14

I don't think this is the time of the host, but I am not sure.

function getTheTime() 
    local timeDate = getRealTime() 
    local year = timeDate.year 
    local month = timeDate.month 
    local monthday = timeDate.monthday 
    local hour = timeDate.hour 
    local minute = timeDate.minute 
    local second = timeDate.second 
     
    return monthday.."-"..month.."-"..year.." "..hour..":"..minute..":"..second 
end  

Any ideas?

Thanks.

76561198066470453.png

SP37Ecj.jpg?2MTA:Rust Pre-Alpha Build v.0.3:SP37Ecj.jpg?2

https://forum.mtasa.com/viewtopic.php?f=114&t=97848

2Pac: ''Only God can judge me!''

Posted

try this

local year = timeDate.year + 1900 
local month = timeDate.month + 1 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

[quote name=..:D&G:..]Works perfectly now, thanks :D

You are welcome

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...