[Complicated] Time difference
#1

My problem goes like this:

- so we have Gettime function (https://sampwiki.blast.hk/wiki/Gettime) and it works how it should, but..

If I have server hosted in Germany (on example), and I want to have exact time from my country (because I dont live in Germany) .. how can I achieve that?

I did some *time calculations in past, but it ends up very inaccurate.. by that, I mean, I was literally adding minutes and seconds to match with time I have in my country.


And later I found out about this page => http://wwp.greenwichmeantime.com/tim.../croatia/time/ (I live in Croatia, obviously xD)

Here it counts every second, min and hour exactly as I need it to (in my script). And I wonder, is there a way to put *time information from that website into few variables in my script? And how?

Thanks for reading
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=254915

Check that informing tutorial on Unix Timestamps. Though you have to do the math for your timezone, not really math but determining how to compare your time. Find out what hour 0 is in your timezone, and you can figure out the rest.
Reply
#3

Result is the same

I created FS with custom command to see time with both gettime() and gettime(..params..). I converted gettime() into
hours - mins - secs and I get 2 hours the difference. (because of GMT+2 I think)

I put filtercript on homemade and hosted server, and both differences are 2 hours. So it is basically the same thing.

I must either way do the calculation for time difference that has already shown to be inaccurate (calculation).

Anyway, thanks for help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)