View Full Version : Date help...
01-12-2004, 09:38 PM
var re_date = /^(\d+)\-(\d+)\-(\d+)$/;
I need to have the date in the format of MMddyyyy.
Any help would be greatly appreciated, TIA.
01-12-2004, 10:37 PM
If you want it simple. It doesn't make sure the date written is valid though.
01-12-2004, 11:33 PM
Thanks for you help. I understand how some of the regex works, is there a way to keep the leading zero for the month and/or day?
01-12-2004, 11:48 PM
This one REQUIRES the date to be written using exactly 2 digits for month, 2 digits for date, 4 digits for year. This is a string match. It will return a string, exactly as it looked in the original. So, it already preserves the leading zeroes.
01-13-2004, 04:27 PM
Its working perfectly now. I had a problem with the Date constructor...I had to put the RegEx.1,2,and 3 in the right order.
Thanks for you help.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.