Magento 2 has a CSV processor, that is being used to import and export product and customer related data. For one of my project I had to generate a CSV of the information I received for a product(s) from an API and use the same CSV as an input file for updating the quantity of […]
Tag: date
Date function
Date Time Input Magento
Hello, There are times when backend developer needs to create a form in admin end and we need to have an input box which accepts data and time. In this post I have explained the code for doing this. Open your form file, will be in app\code\local\[NameSpace]\[Module]\Block\Adminhtml\[BlockName]\Edit\Tab\Form.php There is a function _prepareForm() inside it. Add […]
Number of days between dates
One day I was just thinking about days spent by me on this earth, so I decided to make a script for the same. I am writing here the code, just make a new empty php file and copy and paste the script and execute it to find out the days between two dates. Hope […]
Set Default Time Zone
Some of you may have faced the issue for converting timezone for displaying date and time. Means suppose you want to display current time in India, than what will you do for that. You might have added 5 hours and 30 minutes to the default time. But there is already a functionality for that in […]
List Date Difference
Some of you might have come across the requirement for displaying all the dates between give two dates, especially for drop down listing of dates. I have developed a sample code for getting all date ocurrences between give two dates. You can change the date and modify the code as per you requirement.