Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Saiyan Attack on Jun 01, 2016, 03:41 PM

Title: [Problem] Timezone Didn't Show Me Exact Time ?
Post by: Saiyan Attack on Jun 01, 2016, 03:41 PM
Hello All Who Reads This Problem,

I Have A Problem With The Time Zone For My Country But It's Not Showing Me The Exact Time Of My Country For Example:
I'm From Pakistan So My Timezone Is GMT +5 It's Mean The Time At My Country Is 20:25 But The Server Show Me This Time

(https://i.solidfiles.com/Dkw2aPvnjkzL4.jpg)

Here Is The Print That I'm Using ....
print(date(time()+(3600*5)).hour+":"+date(time()+(3600*5)).min);
Have Any Solution To Fix It ? :'(
Title: Re: [Problem] Timezone Didn't Show Me Exact Time ?
Post by: KAKAN on Jun 01, 2016, 04:26 PM
print( date().hour );
Title: Re: [Problem] Timezone Didn't Show Me Exact Time ?
Post by: Thijn on Jun 01, 2016, 04:26 PM
As you probably can guess from your output, date() already returns it in your timezone.
Title: Re: [Problem] Timezone Didn't Show Me Exact Time ?
Post by: Saiyan Attack on Jun 01, 2016, 05:12 PM
Oh @Thijn So I Need To Change My Pc Timezone to utc +0 before i can get the exact time of my country ? And one more thing when i try to get india time which timezone is GMT +4.5 but it show me GMT +4 time not india time
Title: Re: [Problem] Timezone Didn't Show Me Exact Time ?
Post by: Thijn on Jun 01, 2016, 05:13 PM
date(, [format]);

returns a table containing a date/time splitted in the slots:

sec Seconds after minute (0 - 59).
min Minutes after hour (0 - 59).
hour Hours since midnight (0 - 23).
day Day of month (1 - 31).
month Month (0 - 11; January = 0).
year Year (current year).
wday Day of week (0 - 6; Sunday = 0).
yday Day of year (0 - 365; January 1 = 0).
if time is omitted the current time is used.
if format can be 'l' local time or 'u' UTC time, if omitted is defaulted as 'l'(local time).


So use date(time(),'l')
Title: Re: [Problem] Timezone Didn't Show Me Exact Time ?
Post by: Saiyan Attack on Jun 01, 2016, 05:46 PM
Okay @thijn and Thnks For Help ...

[Topic Locked]