Raised This Month: $ Target: $400
 0% 

Server shows incorrect date


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 09-24-2011 , 04:08   Server shows incorrect date
Reply With Quote #1

My plugin shows the time in GMT, I need to show it in GMT+3, how is it possible to change it ? Because I get wrong UnixToTime value.

The result is : 9/24 8:7 (Day/Month Hour:Minute)

As it has to be 9/44 11:07.

I'm using this:
get_systime() + bantime = 1316851662
UnixToTime( get_systime() + bantime , iYear , iMonth , iDay , iHour , iMinute, iSecond );
reinert is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-24-2011 , 13:06   Re: Server shows incorrect date
Reply With Quote #2

Ask the host to update the time on the server. If they won't do that then you just need to add or subtract the difference between your time and GMT (in seconds). But, remember that you will need to either do it for every instance of get_systime() or you should only do it when displaying it and leave all stored values as is.
__________________
fysiks is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-24-2011 , 13:19  
Reply With Quote #3

I added time zone offset consideration (as optional param) to unixtime include, I'll post later today.

http://forums.alliedmods.net/showthread.php?t=91915
__________________

Last edited by ConnorMcLeod; 09-25-2011 at 02:03. Reason: oO
Bugsy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode