Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio-main
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
jio-main
Commits
770b0bd1
Commit
770b0bd1
authored
Feb 25, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
metadata.rst date functions updated
parent
f443b2cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
docs/metadata.rst
docs/metadata.rst
+14
-13
No files found.
docs/metadata.rst
View file @
770b0bd1
...
...
@@ -422,25 +422,27 @@ With complex query:
Tools
-----
W3C Date function
^^^^^^^^^^^^^^
^^^
Date functions
^^^^^^^^^^^^^^
.. code-block:: javascript
// Get RFC1123 date format "Tue, 13 Dec 2011 13:15:16 GMT"
new Date().toUTCString();
// Get ISO8601 date format "2011-12-13T13:15:16.433Z"
new Date().toISOString();
/**
* Tool to get the date in W3C date format
* - "2011-12-13T14:15:16+01:00" with use_utc = false (by default)
* - "2011-12-13T13:15:16Z" with use_utc = true
* Tool to get the date in W3C date format.
*
* @param {Boolean} use_utc Use UTC format
* "2011-12-13T14:15:16.433+01:00"
*
* @param {Date} [date] The date to convert
* @return {String} The date in W3C date format
*/
function getW3CDate(use_utc) {
var d = new Date(), offset;
if (use_utc) {
return d.toISOString();
}
offset = - d.getTimezoneOffset();
function getW3CDate(date) {
var d = date || new Date(), offset = - d.getTimezoneOffset();
return (
d.getFullYear() + "-" +
(d.getMonth() + 1) + "-" +
...
...
@@ -481,4 +483,3 @@ Sources
* https://en.wikipedia.org/wiki/Internet_media_type
* https://www.iana.org/assignments/media-types
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment