By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,648 Members | 1,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,648 IT Pros & Developers. It's quick & easy.

Tags for month, year, day?

P: n/a
Hi,

I'm using this HTML for listing dates of weblog posts:

<h2>05<span class="month">07</span><span class="year">04</span></h2>

I'm not keen on those spans, though - does anyone know of a more semantically
meaningful way of differentiating between day, month, and year?

--
'But the subject of such empty talk, which has so little to do with humanity,
will tomorrow have finally made our universe into a stinking pit of corpses'
- Lucien Febvre
Jul 20 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
la_haine wrote:
Hi,

I'm using this HTML for listing dates of weblog posts:

<h2>05<span class="month">07</span><span class="year">04</span></h2>

I'm not keen on those spans, though - does anyone know of a more semantically
meaningful way of differentiating between day, month, and year?


No. Why would you want to style each one of them differently, anyway?
Matthias

Jul 20 '05 #2

P: n/a
"la_haine" <p.*****@kent.ac.uk> writes:
I'm using this HTML for listing dates of weblog posts:

<h2>05<span class="month">07</span><span class="year">04</span></h2>

I'm not keen on those spans, though - does anyone know of a more
semantically meaningful way of differentiating between day, month,
and year?


<h2>5 July 2004</h2>
or if you insist on using a purely numeric format,
<h2>2004-07-05</h2>
is at least less ambiguous.

--
Chris
Jul 20 '05 #3

P: n/a
Matthias Gutfeldt <sa************@gmx.net> wrote in
news:2k************@uni-berlin.de:
<h2>05<span class="month">07</span><span class="year">04</span></h2>

I'm not keen on those spans, though - does anyone know of a more
semantically meaningful way of differentiating between day, month, and
year?


No. Why would you want to style each one of them differently, anyway?


Because I like to.

--
'Street surveillance cameras, sir. Most towns and villages are now fitted
with them. Crime prevention, we like to call it. Sounds a bit better than
"Big Brother is watching you", but it amounts to the same thing.'
- Robert Rankin, Apocalypso
Jul 20 '05 #4

P: n/a
"la_haine" <p.*****@kent.ac.uk> wrote in message
news:cc**********@athena.ukc.ac.uk...
Hi,

I'm using this HTML for listing dates of weblog posts:

<h2>05<span class="month">07</span><span class="year">04</span></h2>

I'm not keen on those spans, though - does anyone know of a more semantically meaningful way of differentiating between day, month, and year?


How about <span title="Date: month-day-year">05-07-04</span>
Jul 20 '05 #5

P: n/a
On Mon, 5 Jul 2004 14:45:27 +0000 (UTC), "la_haine"
<p.*****@kent.ac.uk> wrote:
Hi,

I'm using this HTML for listing dates of weblog posts:

<h2>05<span class="month">07</span><span class="year">04</span></h2>

I'm not keen on those spans, though - does anyone know of a more semantically
meaningful way of differentiating between day, month, and year?


HTML doesn't have any way of representing structured dates, for better
or worse. In general, the content parts of HTML elements are intended
for humans to interpret, not browsers.

I advise that if you want to take an approach similar to what you've
posted here you beware browsers which will disregard your style
suggestions. In the above case, the user would see:

050704

Which is just a number. No indication that it's a date. Instead you
have to find some way of marking it all up so that, if you remove all
of the style stuff, you get a human-readable date.

With all that said, it's probably better to just forget this plan
completely and write the date in a way that a human (who reads
English) can interpret unambiguously:

5th Jul 2004

You could still wrap the component parts in SPAN if you really want
to.

Best regards,
-Claire
Jul 20 '05 #6

P: n/a
C A Upsdell wrote:
"la_haine" <p.*****@kent.ac.uk> wrote in message
news:cc**********@athena.ukc.ac.uk...
Hi,

I'm using this HTML for listing dates of weblog posts:

<h2>05<span class="month">07</span><span class="year">04</span></h2>

I'm not keen on those spans, though - does anyone know of a more

semantically
meaningful way of differentiating between day, month, and year?


How about <span title="Date: month-day-year">05-07-04</span>


Or better, year, month, day. Rember an American will think 01-02-03 is a
different date (january 2ns 2003) from a European (1st february 2003) and
some think it's 3rd february 2001.

See the W3C guidance on this:
<http://www.w3.org/QA/Tips/iso-date>

--
Matt
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #7

P: n/a
"Matt" <no******@spam.matt.blissett.me.uk> wrote in message
news:pa****************************@spam.matt.blis sett.me.uk...
C A Upsdell wrote:
"la_haine" <p.*****@kent.ac.uk> wrote in message
news:cc**********@athena.ukc.ac.uk...
Hi,

I'm using this HTML for listing dates of weblog posts:

<h2>05<span class="month">07</span><span class="year">04</span></h2>

I'm not keen on those spans, though - does anyone know of a more

semantically
meaningful way of differentiating between day, month, and year?


How about <span title="Date: month-day-year">05-07-04</span>


Or better, year, month, day. Rember an American will think 01-02-03 is a
different date (january 2ns 2003) from a European (1st february 2003) and
some think it's 3rd february 2001.


Yes, I know. But if the primary target audience is Americans, best to use
the order they prefer, with the TITLE attribute to make it clear to others.
My personal preference is YYYY-MM-DD, but then everyone is different.

Jul 20 '05 #8

P: n/a
On Mon, 5 Jul 2004 14:45:27 +0000 (UTC), "la_haine"
<p.*****@kent.ac.uk> wrote:
I'm not keen on those spans, though - does anyone know of a more semantically
meaningful way of differentiating between day, month, and year?


Usual way is to have one element for the whole date, and to specify
the format as being RFC-822 compliant.

--
Smert' spamionam
Jul 20 '05 #9

P: n/a
On Mon, 5 Jul 2004 15:01:59 +0000 (UTC), la_haine <p.*****@kent.ac.uk>
wrote:
Matthias Gutfeldt <sa************@gmx.net> wrote in
news:2k************@uni-berlin.de:
<h2>05<span class="month">07</span><span class="year">04</span></h2>

I'm not keen on those spans, though - does anyone know of a more
semantically meaningful way of differentiating between day, month, and
year?


No. Why would you want to style each one of them differently, anyway?


Because I like to.

A little web design tip from me to you:

Never style a page because you like it that way. Style a page toward the
end of the benefit of the users. The page isn't for you, it's for them.
Jul 20 '05 #10

P: n/a
Ian
On Mon, 05 Jul 2004 19:45:50 GMT, "C A Upsdell"
<cupsdell0311XXX@-@-@XXXrogers.com> wrote:
My personal preference is YYYY-MM-DD, but then everyone is different.


Mine is "8 Aug 04", or what have you. It's a bit of a hassle
trying to figure out if a site would be using the American system
or the European system. I get to the point of hoping one of the
two numbers is more than 12.

When naming files, though, I use [YY]YYMMDD, so that they're
automatically organized according to date.

Just my $0.02,

Ian
--
http://www.bookstacks.org/
Jul 20 '05 #11

P: n/a
JRS: In article <b5********************************@4ax.com>, dated
Sun, 8 Aug 2004 21:57:02, seen in news:comp.infosystems.www.authoring.ht
ml, Ian <bl***@blank.com> posted :
On Mon, 05 Jul 2004 19:45:50 GMT, "C A Upsdell"
<cupsdell0311XXX@-@-@XXXrogers.com> wrote:
My personal preference is YYYY-MM-DD, but then everyone is different.


Mine is "8 Aug 04", or what have you. It's a bit of a hassle
trying to figure out if a site would be using the American system
or the European system.


And in seven-and-a-half years time how will you know whether 11 Dec 12
refers to a fortnight before next Christmas or a fortnight before last
Boxing Day?

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 20 '05 #12

P: n/a
Ian
On Mon, 9 Aug 2004 11:41:53 +0100, Dr John Stockton
<sp**@merlyn.demon.co.uk> wrote:
in seven-and-a-half years time how will you know whether 11 Dec 12
refers to a fortnight before next Christmas or a fortnight before last
Boxing Day?


Ah, that's a good point. I guess a four-digit year is important.

I imagine people with alternate calendars who are forced to use
ours in places like the Internet, get mightily confused by the
different date formats. So, again, being as unambiguous as
possible is the best pratice, I think, even if the standards
bodies are trying to get everyone to write their dates the same
way. I mean, the US still hasn't adopted the metric system, so we
probably aren't going to write our dates differently any time
before the heat death of the universe. If it were up to me we
would, but it isn't. So 09 Aug 2004 is a practical format, IMO.

Ian
Jul 20 '05 #13

P: n/a
JRS: In article <lv********************************@4ax.com>, dated
Mon, 9 Aug 2004 19:17:50, seen in news:comp.infosystems.www.authoring.ht
ml, Ian <bl***@blank.com> posted :
I mean, the US still hasn't adopted the metric system, so we
probably aren't going to write our dates differently any time
before the heat death of the universe. If it were up to me we
would, but it isn't. So 09 Aug 2004 is a practical format, IMO.


Only for those who have learned the Twelve TLAs in English. Also, forms
with letters in are a little more difficult for programs to read.

The previously-mentioned YYYY-MM-DD is not only an international
standard, but also a US Federal (FIPS) one; it, and YYYY/MM/DD, are
readily recognisable everywhere without ambiguity.

It has the advantage that dates can be compared and sorted as strings,
without any conversion overhead.

It has the advantage of being, by specification and as generally
followed, fixed-length.

It's not quite as obviously a date; but it's generally obvious enough.

In a more sensible world, it, with 24-h hh:mm:ss and a zone indicator,
would have been specified, originally, as the form to be used in
Internet date headers.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 20 '05 #14

P: n/a
"Ian" <bl***@blank.com> wrote in
comp.infosystems.www.authoring.html:
On Mon, 9 Aug 2004 11:41:53 +0100, Dr John Stockton
<sp**@merlyn.demon.co.uk> wrote:
in seven-and-a-half years time how will you know whether 11 Dec 12
refers to a fortnight before next Christmas or a fortnight before last
Boxing Day?


Ah, that's a good point. I guess a four-digit year is important.

I imagine people with alternate calendars who are forced to use
ours in places like the Internet, get mightily confused by the
different date formats.


There's really no need, since an ISO standard exists and dates
written in that format are unambiguous. Today, for instance, is
2004-08-10.

Reference: http://www.cl.cam.ac.uk/~mgk25/iso-time.html

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.