jacko310592 Posted March 24, 2010 Share Posted March 24, 2010 hey guys, i have this following line of code which i use to get users of a certain age range, but i need it to read from the UK date format (DD-MM-YYYY) dob BETWEEN DATE_SUB(CURDATE(),INTERVAL {$ageTo} YEAR) AND DATE_SUB(CURDATE(),INTERVAL {$ageFrom} YEAR) can someone please tell me how to change from the US format? thanks Quote Link to comment https://forums.phpfreaks.com/topic/196418-curdate-in-uk-format/ Share on other sites More sharing options...
o3d Posted March 24, 2010 Share Posted March 24, 2010 Cast all date values to timestamp to not be dependent on a date string format. where cast(dob as timestamp) between cast('{$ageFrom}' as timestamp) and cast({$ageTo}' as timestamp) Quote Link to comment https://forums.phpfreaks.com/topic/196418-curdate-in-uk-format/#findComment-1031337 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.