![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
quick php date() work-alike for nodejs
var phpdate = require('phpdate-js');
var gmdate = require('phpdate-js').gmdate;
phpdate('Y-m-d H:i:s T');
// => "2014-11-27 13:58:02 EST"
gmdate('Y-m-d H:i:s T', new Date());
// => "2014-11-27 18:58:02 GMT"
phpdate('Y-m-d H:i:s', 1234567890000);
// => "2009-02-13 18:31:30"
Supports all php 5.5 conversions, except the ISO 8601 W and o are not yet implemented. See php's date for the descriptions.
The conversion is very quick, as fast as the "Ultra fast javascript strftime" ultra-strftime; faster than Date().toString().
Had I known about ultra-strftime, it would have been tempting to implement phpdate as a format conversion preprocessor.
return a formatted date string like PHP's date()
does. The output will be
adjusted for the local timezone in effect. Supports all conversions other
than the ISO-8601 W and o (in progress), though timezone and localization
support is limited to North America.
Format is the timestamp conversion specifier. Format control characters are replaced with formatted values; other characters are left as-is. Backslash escapes the special meaning of a character. For instance, 'Y-m-d H:i:s' formats an ISO 9075 SQL datetime such as '2014-01-02 12:34:56'. The date and time are formatted for the current locale, with timezone and daylight savings adjustments applied.
The timestamp is optional. If omitted, the current date is used. If specified, it can be a Date object or a JavaScript millisecond timestamp (milliseconds since the epoch).
var phpdate = require('phpdate-js');
phpdate('Y-m-d H:i:s.u T'); // 2014-10-18 04:56:53.437000 EDT
Identical to phpdate, but the timestamp is formatted as UTC, without timezone or daylight saving adjustments.
var gmdate = require('phpdate-js').gmdate;
var now = gmdate('Y-m-d H:i:s T');
// => "2014-11-27 19:17:50 GMT"
FAQs
fast php date() work-alike for nodejs
The npm package phpdate-js receives a total of 40 weekly downloads. As such, phpdate-js popularity was classified as not popular.
We found that phpdate-js 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
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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.