Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Regular expression for mm/dd/yyyy

Posted on 2004-08-25
1
Medium Priority
?
1,608 Views
Last Modified: 2006-11-17
What regular expression will get month, day year from mm/dd/yyyy?
0
Comment
Question by:RichardFox
1 Comment
 
LVL 9

Accepted Solution

by:
AlanJDM earned 500 total points
ID: 11894045
Why use a regex? Use the date() function...

$date = '08/25/2004';
$month = date('M',strtotime($date));
$day = date('d',strtotime($date));
$year = date('Y',strtotime($date));


Alan
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question