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 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) Link to comment https://forums.phpfreaks.com/topic/196418-curdate-in-uk-format/#findComment-1031337 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.