Server-side time refresh solution

Source: Internet
Author: User
Server-side time refresh younger brother is engaged in mobile games & nbsp; would you like to ask & nbsp; front-end request time on my server & nbsp; I should pass it to him the real-time & nbsp; so I should always refresh myself & nbsp; so how to refresh in real time & nbsp; any solutions require as few resources as possible.
I want to know if my younger brother is a mobile game developer.
Front-end request time on my server
I should pass it to him in real time on my server
So how can I refresh myself in real time?
Are there any solutions?
Use as few resources as possible

Mobile game server frontend

Share:


------ Solution --------------------
Your "visualization" is also a solution, but it is not that you refresh the time (time exists objectively) but that you express it in your way.
Generally, this is not the case. Instead, the server time is sent to the user at the beginning, which is used to calculate the time difference between the user time and the server time. There is a lot of code for this js countdown. you can find it.

------ Solution --------------------
That's right.

In addition, you can determine whether it is within the time range when you really "receive the prize ".

What time () is obtained on the server always the current server time? @ Xuzuning
------ Solution --------------------
Reference:
That's right.

In addition, you can determine whether it is within the time range when you really "receive the prize ".

What time () is obtained on the server always the current server time? @ Xuzuning


Time () obtains the server time. You can do this: Pass the server time at the beginning, and take the server time as the standard during verification. it doesn't matter how Rice is stored on the client side, after all, the key factor for determining success is in the hands of the server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.