Closed Thread Icon

Topic awaiting preservation: US vs UK Timestamp Formatting Pages that link to <a href="https://ozoneasylum.com/backlink?for=8007" title="Pages that link to Topic awaiting preservation: US vs UK Timestamp Formatting" rel="nofollow" >Topic awaiting preservation: US vs UK Timestamp Formatting\

 
Author Thread
brucew
Paranoid (IV) Inmate

From: North Coast of America
Insane since: Dec 2001

posted posted 12-30-2001 04:13

I'm cleaning up some code for a client in the UK. One of their requests is to have the file's timestamp displayed in the page footer, and they prefer it updates automatically so they won't have to remember to change it.

"Easy enough," I said. "I'll just put a little script there that reads and displays the last modification timestamp."

Works nice, looks marvy.

Sensitive guy that I am, I wanted to be sure the timestamp was formatted correctly for the UK (I'm even billing in pounds instead of dollars). So I zip off to Control Panel, change the Regional Settings to English (UK) so I can admire my handiwork.

IE6 said, "12/29/2001 21:32:10"

Not what I expected. "Must have to reboot," I thought. So I did.

IE6 said, "12/29/2001 21:32:10"

Huh.

So I checked in with Netscape 6 and Opera 6. They both said, "Sun, 30 Dec 2001 02:32:10 GMT guv".

Right then.

Any thoughts on how to get IE to drive on the left side of the road?

<edit> Fixed typos </edit>

"the most incredible feats are often accomplished by
those who have had the most incredible challenges"

[This message has been edited by brucew (edited 12-30-2001).]

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 12-30-2001 04:21

Can you show the code you are using for this?

Can you get the last modified value via JS? I wasn't aware this was possible?



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 12-30-2001 04:36

You could always use SSI instead. Plenty of Time formatting options



brucew
Paranoid (IV) Inmate

From: North Coast of America
Insane since: Dec 2001

posted posted 12-30-2001 06:37

The script, if one statement can be called a script, is:

<script type="text/javascript">document.write(document.lastModified)</script>

Regarding SSI:
They have an aversion to SSI. They usually use grad students to maintain the site. (This is a one-off fix-it job for me.) Once upon a time a grad student put in a lot of server-side scripting (something they affectionately call "Site Mangle".) My job is to remove all traces of server-side scripting because their current crop of grad students don't understand it. Frankly, once past the basics, I'm lost too.

I was just wondering if I was missing something somewhere in IE, or if there was a Q&D workaround. I'm not sure if it will even be an issue, but I can't check with them until after the second.

I can always blame Gates & Co. saying Netscape and Opera correctly interpret the regionalization.

Hey! I know! I'll say it works right on a Mac! Or under Linux!

<edit> Dang typos! </edit>

"the most incredible feats are often accomplished by
those who have had the most incredible challenges"

[This message has been edited by brucew (edited 12-30-2001).]

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 12-30-2001 21:08

Try this

mydate = new Date(document.lastModified);
document.write("This doc last modified at " +mydate.getHours()+":" +mydate.getMinutes()+ "."

+mydate.getSeconds()+ " " +mydate.getDate()+ "/" +mydate.getMonth()+ "/" +mydate.getYear());


This makes the last modified a date object allowing you to use all the methods and properties availible to it

THe SSI solution is nicer and is barely even really server side scripting it's really more a function of the server.



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

brucew
Paranoid (IV) Inmate

From: North Coast of America
Insane since: Dec 2001

posted posted 12-31-2001 16:07

BD: Ah, yes. That would do it. When I'm back at my PC, I'll give it whirl.

Thanks!

DL: I like that tut of yours. I have a question abvout it. You allude to something that could be incredibly useful for me. I've been using FrontPage for almost five years. (Yeah, yeah.) I make extensive use of FP's includes on my site. I want to switch to the standard method but I don't necessarily want to change every filename extension to shtml and then do redirects for every file so that inbound links to the site still work. (We're talking 300 or so pages to rename and redirect.)

You hint that there is a way to alter that through .HTACCESS. I've successfully edited .HTACCESS on several sites, (I have an affinity for custom 404 screens), so I'm not afraid of it. Is there a way to tell the server to also parse other filename extensions looking for and including includes?

I'm on a shared server at my hosting service, BTW, so I can't patch Apache directly.

"the most incredible feats are often accomplished by
those who have had the most incredible challenges"

[This message has been edited by brucew (edited 12-31-2001).]

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 12-31-2001 18:20

brucew - thanks Unfortunately, I don't know anything about .htaccess files. I believe Emporer and Warmage were the ones who suggested I add that bit, and I linked to the only .htaccess tutorial we currently have on the GN site temporarily. Emporer is planning a tutorial that will cover that end if it, and I will link to that once it is finished. In the mean time, maybe he'll pop in here....or you could hop over to the GN, or up to the Server Side Scripting forum here and track him down

{{edit - to answer the question partially (now that I re-read your question) - yes, you can. You'll notice that the GN pages are all .html, and the entire site is built around SSI. I just don't know how. }}



[This message has been edited by DL-44 (edited 12-31-2001).]

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 12-31-2001 20:41

Add the following line to your .htaccess file:

AddHandler server-parsed .html

Optionally, you can add the following line if SSI isn't already enabled in Apache's main configuration file:

Options Indexes FollowSymLinks Includes

BTW Take a look at this page for more info about SSI: http://bignosebird.com/ssi.shtml


« BackwardsOnwards »

Show Forum Drop Down Menu