Magento Expert Forum - Improve your Magento experience
-
How to get the Current Date using Custom Format in Magento 2
Date and time is an essential element for any business to keep track of their data over a different time frame. But when it comes to any CMS or platform, it does provide the functionality to fetch date and time using its default variable without a single line of code and the same thing applied to Magento 2. By default, you can set system date and time using its backend system configuration that you want to use in Magento 2. So, whenever you fetch date and time it uses its default type as shown below.
2019-10-21 18:15:30
But while custom development, many times it happens that you have to fetch date and time in a specific format. Also, Magento 2 is not providing an option to fetch date in a different format. So, you have to manually code for it.
To do the same first you need to create an “Index.php” file using the following code at the below path.
app\code\Vendor\Extension\Controller\Getformattedd ate\
for more information visit this: https://magecomp.com/blog/get-the-cu...-in-magento-2/
View more threads in the same category:
- buy a USA/UK passport online( https://legitcleandocs.com)visa, SNN, id card
- buy registered drivers license (legitcleandocs.com)IELTS, id
- Modalert 200 - Treat Your Oversleeping Issue
- Buy Passport,Driver License,Age & ID Card,(Whatsapp:.......: +1 (551) 239-2904) Visas
- Buy Passport,Driver License,Age & ID Card,(Whatsapp:.......: +1 (551) 239-2904) Visas
- buy real drivers license(https://legitcleandocs.com)buy Austria id card, passports
- Buy registered passport and driver's license online
- buy real passports online(https://legitcleandocs.com)drivers license, visa, id card
- BUY UNDETECTABLE GRADE A+ COUNTERFEIT BANKNOTE(legitcleandocs.com)
- Connecting the Dots: How to Get Magento 2 API Keys
-
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks