![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
ServerDate is used in web pages to make the server's clock available to the client's browser via JavaScript.
ServerDate is used in web pages to make the server's clock available to the client's browser via Javascript.
You can use it when you want to display the current time but don't trust the browser's clock to be accurate, or to synchronize events for different users of your web site by synching them all to the server's clock.
Usage is simple. Add one <SCRIPT>
element to your web page and then you can
use the ServerDate
object in Javascript just like you use the built-in Date
object, except that it reflects the server's time instead of the client's.
You need Node.js or PHP running on your web server.
ServerDate has been tested in the following browsers:
Make your server look something like the example in the Node.js
directory and
include the following <SCRIPT>
element in your web page:
<SCRIPT src="ServerDate.js"></SCRIPT>
Upload ServerDate.js
and ServerDate.php
to your web server and include the
following <SCRIPT>
element in your web page:
<SCRIPT src="ServerDate.php"></SCRIPT>
You may then use ServerDate
as you would use the Date
object or one of its
instances, e.g.:
> ServerDate()
"Mon Aug 13 2012 20:26:34 GMT-0300 (ART)"
> ServerDate.now()
1344900478753
> ServerDate.getMilliseconds()
22
There is also a new method to get the precision of ServerDate's estimate of the server's clock (in milliseconds):
> ServerDate.toLocaleString() + " ± " + ServerDate.getPrecision() + " ms"
"Tue Aug 14 01:01:49 2012 ± 108 ms"
You can see the difference between the server's clock and the browsers clock, in milliseconds:
> ServerDate - new Date()
39
There is no constructor because it doesn't make sense to create more than one
instance of ServerDate
.
Methods from Date
to change the time, such as setMinutes
, are not defined:
> ServerDate.setMinutes
undefined
ServerDate
is synchronized with the server's clock when it is first loaded and
then re-synchronizes itself from time to time to keep the two clocks from
drifting apart.
See the included file example.html for an example of usage.
ServerDate complies with Semantic Versioning.
Copyright 2012 David Braun
This file is part of ServerDate.
ServerDate is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
ServerDate is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with ServerDate. If not, see http://www.gnu.org/licenses/.
FAQs
Make the server's clock available to the browser.
The npm package serverdate receives a total of 11 weekly downloads. As such, serverdate popularity was classified as not popular.
We found that serverdate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.