Link to home
Start Free TrialLog in
Avatar of praveen1981
praveen1981Flag for India

asked on

Regular Expression for yyyymmdd in c#.net

Hi
can you please say me how to do Regular Expression for yyyymmdd in c#.net

Avatar of sachinpatil10d
sachinpatil10d
Flag of India image

^([2-9]\d{3}((0[1-9]|1[012])(0[1-9]|1\d|2[0-8])|(0[13456789]|1[012])(29|30)|(0[13578]|1[02])31)|(([2-9]\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00))0229)$
Avatar of Anil Golamari
DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.GetCultureInfo("en-US"));

Try above code.
ASKER CERTIFIED SOLUTION
Avatar of SAMIR BHOGAYTA
SAMIR BHOGAYTA
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of praveen1981

ASKER

It Solved