Reputation: 21
I have used date picker and stored it into Mongo collection. I am trying to display it in the format of dd/mm/yyyy
. But I want weekday of the date (i:e:
MON, TUE, etc), date and month (in words like JAN, FEB, etc).
How can we do that?
Upvotes: 0
Views: 76
Reputation: 21
Here is the code for date
<?php echo "date:".date("D/M/yyyy",strtotime($yourdate)); ?>
Upvotes: 0
Reputation: 1288
This might help you...
function isDate_DD_MMM_YYYY(inputString) {
var rxDatePattern = /^(\d{1,2})(\/|-)(?:(\d{1,2})|(jan)|(feb)|(mar)|(apr)|(may)|(jun)|(jul)|(aug)|(sep)|(oct)|(nov)|(dec))(\/|-)(\d{4})$/i;
var dateParts = (inputString.value).match(rxDatePattern);
if (dateParts != null)
return true;
else
return false;
}
Upvotes: 1