Skip to main content

Posts

Showing posts from July, 2018

PHP Add days into date but ignore weekends

PHP Add days into date but ignore weekends If we want to add days into php date then we can add days by below code: Add n days to current date   <? php $date = date("Y-m-d") ; echo date ( 'Y-m-d' , strtotime ( $date . ' + 1 days' )); echo date ( 'Y-m-d' , strtotime ( $date . ' + 2 days' )); ?>   Add n days to specific date   <? php $date = "2018-07-23" ; echo date ( 'Y-m-d' , strtotime ( $date . ' + 1 days' )); echo date ( 'Y-m-d' , strtotime ( $date . ' + 2 days' )); ?>     Question : But What if we want to add days to date but ignore weekends day like Saturday and Sunday ? Answer Yes we can ignore by using Weekdays with nth days. here is the example of it :- Add n days to php date but ignore saturday and sunday <?php $date = "2018-07-23" ; echo date( 'Y-m-d', strtotime($date. ' +200 Weekdays...

Install MongoDb latest version on linux

  Install MongoDB on linux?(Latest Version)  In this tutorial we will explain how to install MongoDb on linux ubuntu or mint. here we are installing latest version of MongoDb but you can install any version . Here we have 3 sections for this tutorial . 1) Install MongoDb 2) Common Issues and errors during installation 3) Test MongoDb Server So keep follow the below steps to install MongoDB. 1) Download MongoDb To download mongodb , first go to the  mongodb.com and browse download page or you can directly go to the https://www.mongodb.com/download-center page and download the appropriate version according to your OS. 2) Now after download it , copy the zip file and create a folder "mongo" in home directory and paste it into it and extract it . now create a new folder "mongo-data" to store database in it. here we are changing our default database storage folder so our data will be save in this directory. After this our directory structure will ...