[Problem] Timezone Didn't Show Me Exact Time ?

Started by Saiyan Attack, Jun 01, 2016, 03:41 PM

Previous topic - Next topic

Saiyan Attack

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



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 ? :'(

KAKAN

oh no

Thijn

As you probably can guess from your output, date() already returns it in your timezone.

Saiyan Attack

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

Thijn

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')

Saiyan Attack

Okay @thijn and Thnks For Help ...

[Topic Locked]