Text and Date Manipulation

D

Dag Sunde

Dr John Stockton said:
JRS: In article <[email protected]>, dated
Mon, 14 Mar 2005 15:39:58, seen in kaeli


That page is Copyright 1999-2005 by Refsnes Data. Therefore, it really
ought to be correct by now. It is not.

Ignoring follies such as writing "The getUTCDate method returns the
Universal Coordinated Time", I see the following clear errors :

At the bottom of almost every page at w3schools is the following:

"We Help You For Free. You Can Help Us!
....
Help us correct errors and broken links
Help us with spelling and grammar
....
(The above are hyperlinks...)

Why don't you help them getting better, instead of criticising them
for having wrong or outdated information?
 
R

RobG

Dr John Stockton wrote:
[...]
Stick to yyyy; ccyy has no advantages.

I always presumed that the 'c' stood for the Roman numeral for
'100', and therefore presumed that if that format is to be used
at all, it should be 'MCXy' - or in long-hand English:

'thousands hundreds tens units of years'.

Which would confuse the heck out of those who don't plain laugh
at the pseudo-intelligentsia of it all - bah gum.
 
S

SGershon

Thanks for the selection tip. Worked great.

I want to use dd/mm/yyyy, because the date is intended for local
audience, not worldwide users. People here are used to dd/mm/yyyy, and
I don't want to confuse them.
I prefer to confuse javascript and myself...

I tried the faq and the merlyn pages, but I could not find any help.
 
S

SGershon

Thanks for the helping hand.

As in a previous post, the audience of the site is local, and I don't
want them to be confused with the dating.
Standard here is d/m/yyyy, and I am pushing towards dd/mm/yyyy, because
that is a minor change.

Maybe I need to check the string, and then strip the digits and
re-construct the date inside the calculation function... but it seems
such a wrong option! It should be a way to tell date() that the format
in use is another.

SGershon
 
S

SGershon

Hi all.
Just updating you all.

In the end, I am doing the not so elegant re-construction of the date
format inside the calculation function.
I still think that there might be a better and correct solution, but I
believe that time will learn it to me.

What I mean is, that after ensuring the date format received, I do:
var dat1f =
dat1.substring(3,5)+\"/\"+dat1.substring(0,2)+\"/\"+dat1.substring(6);

Thanks again for the helping tips!

SGershon
 
D

Dr John Stockton

JRS: In article <[email protected]>
, dated Sun, 20 Mar 2005 14:52:15, seen in
SGershon said:
What I mean is, that after ensuring the date format received, I do:
var dat1f =
dat1.substring(3,5)+\"/\"+dat1.substring(0,2)+\"/\"+dat1.substring(6);

That can more elegantly be done by something like

var dat1f = dat1.replace(/(..).(..).(....)/, "$2/$1/$3")
or
var dat1f = dat1.replace(/(\d+)\D+(\d+)\D+(\d+)/, "$2/$1/$3")

<URL:http://www.merlyn.demon.co.uk/js-dates.htm>
<URL:http://www.merlyn.demon.co.uk/js-valid.htm>
 
S

SGershon

Hey!
Thanks, it is much nicer, as it makes clear to any one reading the code
what I am intending to do.
The way I was using does the same, but was confusing.

SGershon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top