WhoAmI Posted March 5, 2015 Share Posted March 5, 2015 I'm using this https://wiki.multitheftauto.com/wiki/FormatDate But this returns me my time - 1hour. Is there a way to fix that? Link to comment
.:HyPeX:. Posted March 5, 2015 Share Posted March 5, 2015 It is just detected from the server / client machine it was run from. if you use a client-side code, you'll be fine. it'll show the player its correct time. Link to comment
WhoAmI Posted March 5, 2015 Author Share Posted March 5, 2015 I'm using clientside. I'm converting date from created timestamp. Link to comment
WhoAmI Posted March 5, 2015 Author Share Posted March 5, 2015 And one more problem. Look: http://scr.hu/4lpu/ow6h0 And on server I got http://scr.hu/4lpu/ebqoe But it should be the same as an image above. Link to comment
.:HyPeX:. Posted March 5, 2015 Share Posted March 5, 2015 Probably you're just misunderstanding. The one at your server is labelled DD/MM/YY, while the one at the converter is labelled MM/DD/YY. Link to comment
WhoAmI Posted March 5, 2015 Author Share Posted March 5, 2015 I mean minutes. Don't talk to me like to amateur. In both pictures time stamp is the same but I'm getting different values after converting to date. Link to comment
.:HyPeX:. Posted March 5, 2015 Share Posted March 5, 2015 Use the original GetRealTime and check results. Link to comment
WhoAmI Posted March 6, 2015 Author Share Posted March 6, 2015 Made my own function and works now. function formatDate ( timestamp ) if ( tonumber ( timestamp ) ) then local time = getRealTime ( timestamp ) return string.format ( "%02d.%02d.%02d %02d:%02d", time.monthday, time.month + 1, time.year + 1900, time.hour, time.minute ) end end Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now