Sydney T. Fisher

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromSydney T. Fisher
ToMe
SubjectWhen was x months ago?
Date29 April 2005 23:59
I'm a bit of a stickler, but I noticed in you tutorial that several pages
were updated x months ago. Problem is, what date is "now?"  If your reader
does not know when "now" is, he or she has no way of knowing when x months
ago was.

I have seen the same lack in history documentaries on TV.  Captions or
narrators refer to "ago" but there is no way to know when the documentary
was created.  The documentary should name specific, absolute dates.

Good tutorial.

Sydney Fisher
FromMe
ToSydney T. Fisher
SubjectRe: When was x months ago?
Date30 April 2005 00:09
Sydney,

The "updated" phrase is generated on the fly, and is therefore updated
every time you load the page. So "two months ago" really means that. Two
months ago.

> If your reader does not know when "now" is  ...

If the reader does not know when 'now' is then an actual date would be even
less useful, as they would have no idea how long ago the date that I would
put is.

> I have seen the same lack in history documentaries on TV.  Captions or
narrators refer to "ago" but there is no way to know when the documentary
was created.

But unlike a documentary, I can update it in realtime, so every time they
visit, it will be correct.

> The documentary should name specific, absolute dates.

I will remember that if I ever make a TV documentary ;)


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromSydney T. Fisher
ToMe
SubjectRe: When was x months ago?
Date30 April 2005 18:06
Hello, Mark,

That is fascinating!  I never knew that HTML allowed the actual date to be
determined on the fly and the "months ago" kept current.  I take it the
browser (perhaps using JavaScript?) picks the present date off the user's
computer and does the arithmetic based on the date the document was updated?
Could an applet display a "clock" that would indicate the real local time?

I am messing around with HTML, although I have no plans to create a web
site.  I might build a part of a web site for the retirement home I plan to
enter in a few years when construction is complete.

Now, with your permission, I'll pick your brains a bit.  I have made an
HTML <MAP> of an image of the home's "commons" with "areas" for the dining
room, club room, cafe, etc.  When an area is clicked, a page comes up with
information about the place that was clicked.

Suppose I wanted to put little "stickers" or "tags" (not HTML tags) on the
image of the commons where the areas are.  The image itself, which I
scanned from a brochure, isn't very clear.  Can such labels be superimposed
on the image in some way without altering the image itself?  Does HTML
support something like <MAP> to place small images in given "areas" on top
of a larger image?

Again, thank you for coming back to me.  I had visions of your snorting
"who is this upstart?" and throwing my email into your computer's trash.

Best, Sydney
FromMe
ToSydney T. Fisher
SubjectRe: When was x months ago?
Date30 April 2005 21:43
Sydney,

> I never knew that HTML allowed the actual date to be determined on the
> fly and the "months ago" kept current.

The HTML itself does not. You might notice I use PHP to serve the page:
http://www.howtocreate.co.uk/tutorials/javascript/operators

PHP is a server-side programming language. Every time you ask for the page,
my PHP program on the server pieces the HTML page together from a few files,
and serves it to you as a single page. It calculates the date based on the
last modified date of the chapter file, and the current time on the
server's clock. This is inserted into the page just like a regular piece of
HTML, so the browser does not even know the page was specially generated.

> Could an applet display a "clock" that would indicate the real local time?

JavaScript can indeed check the local time, and display a clock. This can
be displayed in a variety of different ways - I have one that displays an
analog clock:
http://www.howtocreate.co.uk/tutorials/jsexamples/anclock.html

This is done using the Date object:
http://www.howtocreate.co.uk/tutorials/javascript/javascriptobject#io

Java applets (totally different thing), and plugins like Flash can also do
similar things - although they generally require a lot more code or
bandwidth.

> Does HTML support something like <MAP> to place small images in given
> "areas" on top of a larger image?

From the sound of it you are already using an image map:
<map name="foo">
The areas accept a 'title' attribute, and this should appear as a tooltip
when you hold your mouse over the area.
<area href="bar.html" title="Club room" ...>

If you want something more permanent, HTML itself does not provide a way to
overlay images or text, but you can style it with CSS to place the labels
wherever you want. Not ideal, but it would work:

<div style="position:relative;">
 <img src="map.gif" usemap="foo" alt="" height="300" width="500">
 <div style="position:absolute;top:35px;left;155px;">
  <img src="label1.gif" alt="cafe" height="20" width="100">
 </div>
 <div style="position:absolute;top:240px;left;300px;">
  Dining room
 </div>
</div>

-- 
Tarquin
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.