Questions tagged [date]

A date is a reference to a particular day represented within a calendar system, and consists of year, month and day.

Filter by
Sorted by
Tagged with
0
votes
2answers
26 views

Sort products by date Magento 2.4.1

$this->_collection->addAttributeToSort('created_at', 'DESC'); // not working $this->_collection->setOrder('created_at', 'DESC'); // not working //$this->_collection->setOrder('...
1
vote
1answer
834 views

Order Date is correct on the order itself in Admin but incorrect in the Order Confirmation Email (it shows exactly 7 hours more)

The orders show the correct Order date in Admin but incorrect Order date (time) on the Confirmation Email. The time on the Confirmation Email is exactly (to the second) 7 hours more. An example: ...
0
votes
0answers
16 views

Magento2 change time for datepicker

Currently, time for Holiday time picker is [from] => 2021-03-24 00:00:00 [to] => 2021-03-24 00:00:00 Need to change to [from] => 2021-03-24 00:00:00 [to] => 2021-03-24 23:59:59 The ...
0
votes
1answer
840 views

ERR (3): Warning: date() expects parameter 2 to be long

What is not correct about this statement? It came from the theme developer's files. ERR (3): Warning: date() expects parameter 2 to be long, object given in /home/WEBSITE/public_html/app/code/local/...
1
vote
2answers
1k views

How to add/subtract month to/from date in Magento2?

I am getting date by injecting this class in constructor \Magento\Framework\Stdlib\DateTime\DateTime as: protected $date; public function __construct( .... \Magento\Framework\Stdlib\DateTime\DateTime ...
0
votes
2answers
855 views

Date filter wrong. Magento always converts the start/end date in a wrong format (UTC)

If I pull up a sales report and filter shipped by 6/1/16 - 6/30/16 I get a weird result (doesn't match a 3rd party report). When I inspect the final sql query Magento sends to the database I noticed ...
0
votes
1answer
40 views

Invoice Date sets to 1 Jan 1970 when set to “Paid”

Does anybody please know why some invoices on Magnento 1 are automatically reverting to 1 Jan 1970 for the purchase date and due payment date when they are set to paid? Many thanks in advance
1
vote
1answer
982 views

Custom Date Range in Admin Dashboard

I am working on a task to modify Date Range on Dashboard chart. Data chart will display on custom date range selection (Today/Yesterday/This Week/Last Week/This Month/Last Month). I have extend the ...
0
votes
2answers
907 views

Magento 2 how to restrict previous date in datepicker , for frontend detail page custom options

In Magento 2 how to restrict previous dates in datepicker ,in detail page customizable options, Please help me out on this .
0
votes
1answer
975 views

How to put correct date on invoice PDF in Magento 2?

Invoice PDFs are generating the incorrect date, I have this on two sites both on 2.3.4 and en_GB locale e.g. $order->getCreatedAt() 2020-02-14 11:14:40 becomes $this->_localeDate->formatDate( ...
2
votes
1answer
3k views

How do I change date picker format for admin date field

How can I change the date format to display as dd/mm/yyyy for admin date field? Currently it is displaying as mm/dd/yyyy format. Can you please help me out?
0
votes
4answers
47 views

how to use date() in magento query?

I want to filter some orders based on the date range so in SQL i use this query SELECT * FROM `sales_order` WHERE date(created_at) >= '2020-12-02' AND (date( created_at) <= '2020-12-...
1
vote
1answer
910 views

Set Product as New from Date - Reverts to random date in past after clicking out of product edit

We have an issue with using New From Date as filter in product grid Steps - on admin go to products > catalog - in columns make sure you have 'set product as new from date' selected - in filters ...
0
votes
1answer
827 views

Magento 2.1 How to change member birthday date format

By default the date format is mm/dd/yyyy when new member register. How can I change the date format of birthday field to dd/mm/yyyy? I have tried to change locale to EN_UK, EN Canada, and also ...
0
votes
2answers
87 views

How to get date of tomorrow in magento2

How can I get date of tomorrow in Magento2? I can use below code to get current date but I couldn't fetch the date of tomorrow. // $this->datetime \Magento\Framework\Stdlib\DateTime\DateTime $...
2
votes
1answer
800 views
4
votes
1answer
5k views

Date field system.xml

I wonder what 'date' type needs in system.xml. I keep getting the error : system.xml (only the field): <field id="date" translate="label" type="date" sortOrder="2" showInDefault="1" showInWebsite=...
0
votes
0answers
22 views

Magento 2: How to add invoice date to invoice email template?

I need to add the date of invoice creation to the invoice email template in format like this: d.m.YYYY (example: 25.12.2020). How can I achieve this?
0
votes
0answers
187 views

Magento 2.4 Sort products by date

I've found topics about enabling sorting by date, this being one example but on 2.4 this does not work, even manually typing ?product_list_order=created_at in url does not get any results, is there ...
1
vote
2answers
1k views

Change order date to invoice date on invoice PDF in Magento 2

How to change the order date in the invoice PDF in Magento 2 to invoice date? I think it's done in the AbstractPdf.php file, but cannot get the right code to pull the right data. It's shown in the ...
0
votes
0answers
17 views

dateRange filter can not properly parse format

I have a datetime column for custom made listing, where date filter calendar can not process given date format. <column name="ticket_time" sortOrder="150" class="Magento\Ui\...
6
votes
4answers
26k views

Magento 2: How to get current date, date time with format in .phtml file?

I already referred Magento 2 Get Current Store Date Time But how to use directly in .phtml file? Can able to get Date, DateTime & Also able to set it's format?
1
vote
2answers
215 views

To date and from date in magento admin

A simple question because google didn't help: In magento admin (coupons, price rules etc.) the "from date" and "to date" fields start at 00:01 that day and end at 23:59 on end date (dates are ...
5
votes
4answers
2k views

Datepicker in widget

What is the best way to create widget with a parameter with date picker? The problem is that I did not find a good way to supply format value to Date element class.
0
votes
1answer
206 views

Magento2 Order Date is Wrong in Admin Grid

We created an order in magento2 with API calls. It is working fine as expected . We have created_at field date as 23-01-2020 12:12:12 in database where as in admin magento2 order grid it is ...
9
votes
3answers
22k views

Magento Filter collection by create times (today, yesterday, week, hour etc)

I have a custom collection that I wish to filter by created date and het entries created "yesterday" Collection Entries //dates are set in controller using setCreatedTime(Mage::getModel('core/date')...
2
votes
1answer
73 views

Magento Frontend form date picker today date is wrong

I want to setup date picker in frontend form, and I did this currently, datepicker is shown in a frontend form only one issue is that when I click on today in datepicker it take the wrong date ...
0
votes
1answer
32 views

Change display month on select box

I have a module and a select box for display month. In file download.phtml, I mentionn value month and I want display that are 01, 02, 03, ..., 12. How can I do that?
0
votes
0answers
15 views

Date field, force using english locale

I would like to add a date field with calendar that uses english language format. So the date should look like 01 february 2011. Problem is that my locale is italian. How to change format and force it ...
1
vote
0answers
16 views

M2 - Weird coupon date change on save

Magento version: 2.3.4 When I create a new shopping cart price rule (coupon code) and choose a date range like this: Then in the coupon overview list I see this date: So that correct, but when I ...
0
votes
2answers
83 views

Notice: A non well formed numeric value encountered

I'm trying to format the DB timestamp to 'm:d:y, something like 07/06/20`. Please change the piece of code below to help achieve it. echo $dbh->Record['fulfillmentDate']; Returns 2020-07-02 02:...
0
votes
0answers
348 views

Importing Date Attributes in DD/MM/YYYY format

When importing products with date fields in format dd/mm/YYYY it throws this error: Value for 'special_to_date' attribute contains incorrect value in row(s): 1, 2, 3 From reading around I see ...
1
vote
2answers
6k views

Magento 2.2.3 How to adjust date format?

The following piece of code: <?= $post->getCreatedAt() ?> Returns the following output: 2018-04-13 11:53:00 How to adjust that piece of code in a way that the output would be something ...
1
vote
3answers
3k views

'No date part in '' found. when upgrading from Magento 1.9.0.x to 1.9.2.2

I have recently done an upgrade to a currently live and active Magento store from 1.9.0.x to 1.9.2.2 and when attempting to add a customer via the front end registration form or accessing customer ...
0
votes
0answers
17 views

Magento 2 backend grid not sorting date

I added a DateColumn component to my backend grid which looks like this <column name="booking_from" class="Magento\Ui\Component\Listing\Columns\Date" component="...
0
votes
0answers
117 views

Magento 2.3.* EE - Cart Price Rule coupon expiration date

I am using Magento 2 EE. I found that there is a new feature of "Schedule Changes" for coupon from_date and to_date. I added both dates in admin for a coupon. But even after the end_date is gone, the ...
3
votes
2answers
2k views

Add Custom Product Grid Created Date And Created By Magento 2

In magento 2 admin panel, at product list grid area, i want to add one more grid with date, that date define product create date. so we get idea at which time product was created. And i also want to ...
2
votes
2answers
1k views

Magento 2 - Problem with datetime attribute product

In Magento2 : When I saved date attribute with time is the same picture below. After I saved it only save date and get no time. Any know reason and how to fix it? In database: after saved When I ...
1
vote
3answers
1k views

Please enter a valid full date translate

We want to translate "Please enter a valid full date", but when we edit the csv file, nothing happens. This is the default Magento validation line in the one page checkout. When a user enters the ...
0
votes
1answer
130 views

Count only business days, without weekend and holidays

I have the current date, in the format I need: Y/m/d And I need to calculate what date will be in X days excluding weekends and holidays. X - because this value is dynamic and can be set in the admin ...
1
vote
1answer
426 views

Magento 2.3 - Transactional email remove time from order date

How can we remove the time in the order created date inside the transactional email? We now load it like this; {{var created_at_formatted}} and displayed as: 9 apr. 2020 11:17:59 We want to remove ...
4
votes
1answer
678 views

Magento 2 inline edit date issues

In magento2 Inline Edit date issues while i edit the record it display current date instead of my date My Ui component <!-- Date Column --> <column name="date" class="Magento\Ui\...
1
vote
0answers
87 views

Magento 2.3.4 Change date picker to 3 drop down dd/mm/yyyy

How to change Magento 2 date picker to 3 drop down which allows users to pick date month and year. Tried to follow this -> DOB Validation with three fields in magento2 But it didn't work and it wasn't ...
0
votes
1answer
43 views

How to render date field in UI component (in php not xml) in magento 2

How to render date field in UI component(in php not xml) in magento 2 I am building form as in the catalog (meta arrays), datetime eav attributes. I have tried like below 'date_of_stock' => [ ...
6
votes
6answers
35k views

Get current date time used in magento for saving data

I want to get current date time which is magento used for save data into database. I searched and get this line of code, Mage::getModel('core/date')->date('Y-m-d H:i:s'); but this is not working ...
0
votes
1answer
205 views

magento 2.3 overide date calendar class

I am trying to override a date calendar class in Magento. But when I try doing it the date input from the product page disappears. Basic I want to override the date calendar script to add custom ...
1
vote
3answers
3k views

Converting a locale date to YYYY-MM-DD

I have a datepicker in my site which formats the time in the current locale. So the time gets sent to the server in d/MM/yy-format. The locale on the frontend is determined by Magento\Framework\...
0
votes
1answer
297 views

convert any date into dateTimestamp in order to compare it

I’m trying to compare the current date timestamp with product special price end date. to get current date I use : $currentDate = Mage::getModel('core/date')->timestamp(time()); and for ...
2
votes
0answers
29 views

Disable a dropdown based on Date attribute

I have created a 2 date attribute which is Date_from and Date_to via back-end. Admin can add these dates and related time slots in another drop-down attribute which is choose_date. In the frontend, ...
9
votes
3answers
7k views

Magento 2 - Best practice to get current date

I have to save an updated_at attribute of a custom entity and to know which is the best practice I took a look at how Magento 2 handles it. I looked at the \Magento\Eav\Model\Entity\Attribute\Backend\...

1
2 3 4 5