What is datetime in HTML? - html

I was learning HTML from a book and a noticed an example,
<del datetime="20040329">fluffy kitten</del>
What does datetime mean and what does it do?

A deleted text, with a date and time of when the text was deleted:
<p>My favorite color is <del datetime="2009-01-08T22:55:03Z">blue</del>
<ins>red</ins>!</p>
more info http://reference.sitepoint.com/html/del/datetime
http://www.w3.org/community/webed/wiki/HTML/Elements/del

The datetime attribute specifies the date and time when the text was deleted.
This links may help you
http://www.w3schools.com/tags/att_del_datetime.asp
http://www.w3schools.com/html5/tag_time.asp
<p>My favorite color is <del datetime="2009-01-08T22:55:03Z">blue</del>
<ins>red</ins>!</p>
Answer

http://www.w3.org/TR/2010/WD-html-markup-20101019/del.html
The del element represents a range of text that has been deleted from a document.
datetime - The date and time when the text was deleted. A valid date-time as defined in [RFC 3339], with these additional qualifications:
the literal letters T and Z in the date/time syntax must always be uppercase
the date-fullyear production is instead defined as four or more digits representing a number greater than 0

It shows when some text was deleted, reference. The deleted text is crossed out.

The datetime attribute specifies the date and time when the text was deleted. It no visual effect in ordinary web browsers,
Syntax
<del datetime="YYYY-MM-DDThh:mm:ssTZD">

Related

Time tag. What should be inside the tag

I have been searching and I saw different ways to use the time tag. For instance:
Last update: <time itemprop="dateModified" datetime="2016-08-15">August 15, 2016</time>
<time itemprop="dateModified" datetime="2016-08-15">Last update: August 15, 2016</time>
I understand that I should use the datetime attribute in a standard way to help machines read it. No doubts about that. But all the information related to time should be inside the tags or only the dates?. In this example, Last update should be inside or outside the time tag?
Although the documentation does not address this question directly, the examples hold only the date related info (in a human readable format) inside the <time> tag.
Also, according to this blog post they point out that although you can put whatever you want inside the tags, it is more common just for it to be a textual human readable representation of what you've got in the datetime attribute.
It's probably a bit more common for the human-readable version to be just a textual representation of the datetime
Following the examples I would update your markup to:
<p>Last update: <time itemprop="dateModified" datetime="2016-08-15">August 15, 2016</time><p>
See the specification:
The time element represents its contents, along with a machine-readable form of those contents in the datetime attribute. The kind of content is limited to various kinds of dates, times, time-zone offsets, and durations, as described below.
The datetime attribute may be present. If present, its value must be a representation of the element's contents in a machine-readable format.
2016-08-15 is the machine readable expression of August 15, 2016. It does not express the information Last update:.
Only the human readable version of the time information should be inside the element.
You should be able to use the content of the element and the content of the datetime attribute interchangeably.

Html element <time> date format without HH MM SS

I am using HTML <time> element to display the date.I have to display only date-part.From back-end I am getting date "13/07/2016 00:00:00" with HH MM SS.
I used below line to convert date-time to date.
<time class="meta" datetime="DD/MM/YYYY">13/07/2016 00:00:00</time>
But still output is same "13/07/2016 00:00:00".
I was referring :-
HTML time tag - correct date format
I think there is some confusion regarding tag.
According to MDN:
This element is intended to be used presenting dates and times in a machine readable format. This can be helpful for user agents to offer any event scheduling for user's calendar.
In your code, <time class="meta" datetime="DD/MM/YYYY">13/07/2016 00:00:00</time>, the output will not change by format you specify by datetime attribute, because it is meant for machine reading, but the text part of this tag that is 13/07/2016 00:00:00 will be visible on page to humans.
If you want to change format of output of this. I think you should use some sort of javascript to format this value, or for a hackish way, you can just split it by space and use first index for just date.
You are using the <time> tag incorrectly. The datetime attribute should be a valid date with an optional time string and it has no effect on the content of the tag.
A valid usage example:
<p>The concert took place on <time datetime="2001-05-15T19:00">May 15</time>.</p>
What you want to achieve is not possible with HTML only. You either format the date on the backend, or use Javascript.

How to set default content of input of type month?

Is it possible to change the default content of this element: (Using Google Chrome)
<input type="month"/>
To make it, for instance, a blank field (default display)?
I don't believe it's possible to make the input field entirely blank, that is without the hyphens.
Is it possible to change the default content...
You can, however, change the default date shown through the value attribute:
<input type="month" value="1963-12" />
This will display December, 1963 (oh what a night...)
Note that the month must be two characters, 0 padded for less than 10.
I would suggest reading up on the other attributes that let you customize the field further.
If you really want to show an entirely blank field, I would suggest using a blank input tag and writing your own functionality to style and format the date within it.

placeholder sentence into new row

I am looking for an solution. If there's no any, well I cannot help it :]
I like placeholder attribute quite a lot. Today/tonight I was making an contact form.
However I am wondering is there any solution to put an word/sentence into new row into placeholder...
Example:
You are suppoused,
to write an message to me...
Instead of:
You are suppoused, to write an message to me...
I hope there is an way. Thanks in advance
From the WHATWG (emphasis mine):
4.10.7.3.10 The placeholder attribute
The placeholder attribute represents a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format. The attribute, if specified, must have a value that contains no U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR) characters.
Seems like a pretty clear no.

Does TEXT in MySQL retain spaces/formatting for XML?

If I embed XML into a TEXT column in MySQL, will it retain the spacing/indentation of the XML blob? Will I need to fix the markup when I retrieve it so it isn't just a long string?
Per the docs, the text you put in will stay untouched (except for possible truncation if you try to put more text in than the datatype can accept). Indeed, there are few differences with VARCHAR: no DEFAULT value, and, if you put an index on a TEXT column, you must specify the prefix length, which is only optional for VARCHAR.