close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Formatting date 11/11/11 gives 11/11/1911 instead of 2011

Thread began 7/30/2010 12:22 pm by amucino12002 | Last modified 8/03/2010 11:05 am by Ray Borduin | 2589 views | 8 replies |

amucino12002

Formatting date 11/11/11 gives 11/11/1911 instead of 2011

When setting a field to be formatted as mm/dd/yyyy and if user enters 11/11/11 it formats as 11/11/1911 instead of 11/11/2011 which makes more sense.
How can this be fixed. ?

I already downloaded the latest version of the extension but still no luck.

This is in an ASP page.

Aleks

Sign in to reply to this post

Eric Mittman

Are you using a client side or server side validation for this? Is this an asp vb or asp js type page?

Sign in to reply to this post

amucino12002

reply

It is under tag inspector, so I dont know which one is it, I am guessing client side. and is in both ASP Javascript AND VBscript.

Sign in to reply to this post

amucino12002

I'dFrawley

Any news on this ?

Sign in to reply to this post

Ray BorduinWebAssist

Unfortunately this is how both client and server side javascripts interprit 2 digit years.

The convention is to use 4 digit years after the year 2000... so any 2 digit years it assumes are from the 1900's.

You say that the year 11 should logically be 2011, but that isn't true if you are asking for a birth date. Also consider all of the years where the year 11 logically meant 1911... it was like that untill the great Y2K scare. Since nobody wanted to go back and correct all of the dates in the past, the solution is to always use a 4 digit date moving forward.

My best suggestion is to use a 4 digit date and to require one. The only other solution would be to create a custom script that parsed the entered date as a string and converted 2 digit dates to 4 digit dates automatically, but we don't supply that code so it would have to be custom written.

Sign in to reply to this post
Did this help? Tips are appreciated...

amucino12002

byBunyan

In the page where I have the reformatting selected they use this for 'passport expiration date', 'document expiration', or even recent travel dates, NONE of which will be in 1911 !!
So it goes both ways. It would be very useful if when we select reformatting from when they type : 11/11/11 we could select if it should reformat to 1911 or 2011 (somehow), this way you got both scenarios covered.
Is there a way to do this or tweak your reformatting ? otherwise Ill have to get rid of it.

Sign in to reply to this post

Ray BorduinWebAssist

There is no way to tweak it without editing and understanding javascript. The traditional solution is to force a 4 digit date, otherwise your database and any other application will understand year 11 to be 1911.

You can of course remove the reformatting, which should be in the onblur event.

Sign in to reply to this post
Did this help? Tips are appreciated...

amucino12002

Is there a way to change the javascript to use 2011 instead ? I dont know that many people who would fill out a form and enter 1911 as their DOB .. my guess is they would have a hard time seeing the screen.

Sign in to reply to this post

Ray BorduinWebAssist

This is just how javascript understands dates...

You'd find even less that were born in 2011... I'm sure they couldn't see a screen.

You could create a dropdown list instead of having them type in a date.

The reality is that if you looked at every time in history someone has referred to a date with '11 as the year... the majority are still talking about 1911. The standard is to use a four digit date after the year 2000. This is how computers work in general, be it javascript, vbscript, php, asp, sql, or any other computer language that I have used.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...