You are not logged in.
Login
or
Register
.
JsPHP: a JavaScript library providing the PHP API
Home
Register
Demo
Categories
Functions
Contributors
Download
Links
Comments
FAQ
Contact
View
Edit
Benchmark
Revisions
Developers
Dependencies
Talk
Links
gmstrftime:
Edit: gmstrftime
Function:
gmstrftime
View gmstrftime
Edit gmstrftime
Edit code
Edit tests
Edit benchmark
View latest code
Edit latest code
Benchmark gmstrftime
Comment on gmstrftime
Comment on the latest code
View revisions
View versions
View contributors
View dependencies
View comments
View links
Download production code
Download development code
View the PHP docs
View phpjs.org
View phpjs.org raw code
Description:
Format a GMT/UCT time/date according to locale settings.
Edit function
Code
:
function gmstrftime (format, timestamp) { // http://jsphp.co/jsphp/fn/view/gmstrftime // + original by: Brett Zamir (http://brett-zamir.me) // + input by: Alex // + bugfixed by: Brett Zamir (http://brett-zamir.me) // - depends on: strftime // * example 1: gmstrftime("%A", 1062462400); // * returns 1: 'Tuesday' var dt = ((typeof(timestamp) == 'undefined') ? new Date() : // Not provided (typeof(timestamp) == 'object') ? new Date(timestamp) : // Javascript Date() new Date(timestamp * 1000) // UNIX timestamp (auto-convert to int) ); timestamp = Date.parse(dt.toUTCString().slice(0, -4)) / 1000; return this.strftime(format, timestamp); }
You have to be logged in to edit functions.
Edit tests
Code
:
You have to be logged in to edit tests.
Edit benchmark
Code
:
You have to be logged in to edit benchmarks.
[
top
]
Comments
There are no comments yet, be the first!
Please
Login
or
Register
to post comments.