Jump to content

Problema time.


Killo

Recommended Posts

Problema este ca hostul nu este din Romania iar ora serverului este cu cateva ore in urma fata de Romania

Poti sa faci o smecherie si sa aduni orele lipsa. In format unde e variabila de ora ii aduni spre exemplu 5(daca sunt 5 ore diferenta intre server si Romania) si va afisa corect

Link to comment
Share on other sites

La 30.11.2017 la 12:08, Banditul a spus:

Problema este ca hostul nu este din Romania iar ora serverului este cu cateva ore in urma fata de Romania

Poti sa faci o smecherie si sa aduni orele lipsa. In format unde e variabila de ora ii aduni spre exemplu 5(daca sunt 5 ore diferenta intre server si Romania) si va afisa corect

Un exemplu ceva?

Link to comment
Share on other sites

Desigur

new h,m,s;
gettime(h, m, s);
format(string,sizeof(string), "%.2d:%.2d%.2d",h+5,m,s);

Si asta va afisa ora actuala a serverului + 5 ore (desigur nu este sigura aceasta metoda pentru ca nu stiu 100% daca nu va face overflow (va trece sub 0 sau va trece peste 24))

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.