473,396 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Tags for month, year, day?

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
14 3853
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
"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
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
"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
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
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
"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
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
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
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
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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Hansan | last post by:
Hi all I am making something for my webpage Where the user can choose a month: I have made that with a dropdown box. <select> <option name = "1" value="1">January <option name = "2"...
6
by: Tony Miller | last post by:
All I have an aggregate query using the function Month & Year on a datereceived field ie: TheYear: Year() TheMonth: Month() These are the group by fields to give me a Count on another field by...
4
by: Ronald Celis | last post by:
Hi, is there anyway to get the Number of days in a given month and Year in C# thanks Ronald Celis
6
by: Ante Perkovic | last post by:
Hi, How to declare datetime object and set it to my birthday, first or last day of this month or any other date. I can't find any examples in VS.NET help! BTW, what is the difference...
22
by: Stan | last post by:
I am working with Access 2003 on a computer running XP. I am new at using Access. I have a Db with a date field stored as mm/dd/yyyy. I need a Query that will prompt for the month, ie. 6 for...
19
by: edfialk | last post by:
Hi, does anyone happen to know of a script that would return the number of seconds in a month if I give it a month and a year? My python is a little weak, but if anyone could offer some...
7
by: ajaydesai | last post by:
I have JavaScript code to dispaly two month calendar days at a time, but i have a problem both month that disaplay at a time have same days (for example May and June has same days, June and July have...
6
by: Nkhosinathie | last post by:
hello guys,i've started with classes and i've been given this program below to program and also i will post the source code if you need it.this program reads as folllows. create a class called...
5
by: gaijinco | last post by:
I'm fairly new to using XML and I tend to be quite verbose when writting files. Is there any disadvantage of writting: <person> <name first="Carlos" second="" /> <lastname first="Obregon"...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.