Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

MongoDB date format dd/mm/yyyy

db.cats.aggregate(
   [
     {
       $project: {
          _id: 0,
          formattedDate: { $dateToString: { format: "%d/%m/%Y", date: "$born" } }
       }
     }
   ]
)
Source by database.guide #
 
PREVIOUS NEXT
Tagged: #MongoDB #date #format
ADD COMMENT
Topic
Name
9+1 =