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
1answer
18 views

Converting this date format 2021-04-26 05:31:38 to 26 Apr, 2021 in magento 2

How can we Convert this date format 2021-04-26 05:31:38 to 26 Apr, 2021 in Magento 2. Please let me know how can I do this.
0
votes
2answers
34 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('...
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
4answers
48 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-...
0
votes
2answers
97 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 $...
0
votes
0answers
29 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
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\...
0
votes
0answers
218 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 ...
0
votes
1answer
34 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
121 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
21 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
130 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 ...
0
votes
1answer
144 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
479 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 ...
1
vote
0answers
97 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
52 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' => [ ...
0
votes
1answer
215 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 ...
0
votes
0answers
383 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 ...
0
votes
1answer
338 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 ...
0
votes
1answer
1k 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
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, ...
0
votes
1answer
249 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 ...
1
vote
0answers
45 views

import date format correct in magento 2

i'm tring to import a date field correct into the special_from_date and special_to_date field of products however for some reason the result is not correct. I have this -<Item> <sku>...
1
vote
0answers
20 views

Report interval date column issue - M2

Admin panel > Reports > Products > Ordered It's magento's default report and result data is showing in 3rd date it's actually of 4th date. Issue is, Data is showing in one day previous in grid. ...
1
vote
1answer
114 views

Magento 2.3 get current local time in phtml

I want to load the current local time in a custom phtml file, that I want to load in my CMS Page. I currently have the following code but that loads the GMC time, not my local time. How can I change ...
0
votes
1answer
716 views

Magento 1.9 - How to get shipped date and display on Customer account My Order?

Backend generate date when we shipped order, Frontend shown only order created dated, Is it possible using event-observer?
1
vote
0answers
99 views

Magento 2 get current time and week days

I use the following code in my Magento 1 store, but I want to convert it to Magento 2. I load this in a custom .phtml file to display on a CMS page. How can rewrite the following for Magento 2? CODE:...
0
votes
1answer
137 views

Date format issue to save giftcard Lifetime in Magento 2

I am creating giftcard code programmatically. For this in vendor GiftCardAccount Module, the code is: $model = $this->giftCAFactory->create()->setStatus( \Magento\GiftCardAccount\...
1
vote
1answer
211 views

Date format missing in admin grid and admin form in magento 2 custom module?

I created a custom module to update news and stories to magento 2 website.I have the date field in my form( main.php ). $dateFormat = $this->_localeDate->getDateFormat( \...
0
votes
1answer
28 views

Store time in js

I need to use current store timestamp in js or phtml file, how can always have current store date-time or timestamp when phtml is cached and I cannot pass this variable to js. Any help will be very ...
1
vote
0answers
185 views

JSON Serialize DateTime in Web API

A lot of my Web API interfaces use DateTime return types or parameters as follows. interface TestInterface { /** * @param \DateTime $value * @return void */ public function ...
1
vote
2answers
525 views

Magento 2 - Admin grid and export use different timezone

I'm using Magento 2. So, I created a Adminhtml data grid in a custom module. The problem is that the data grid doesn't match the exported data. I've set the timezone, but it seems data grid and ...
1
vote
2answers
2k 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 ...
2
votes
2answers
188 views

How to over ride php file in magento 2.3

I want to do some changes in vendor/magento/framework/Stdlib/DateTime/Date.php How can I override the file in app folder?
2
votes
3answers
116 views

M2 - Change end date of all coupon codes

In the database there is a table called salesrule_coupon which has all the coupon codes in it. I need to change the column expiration_date for all the coupons to the same date 30-08-2024, Is This ...
1
vote
2answers
500 views

M2 | How to configure store's timezone to set date as I am getting wrong date in magento?

I get different date from todays date. I tried below ways and all give difference in time: 1) \Magento\Catalog\Block\Product\Context $contexts, .......... .......... $this->...
1
vote
1answer
160 views

Get current date and time in custom module and save that in database in magento 2

I wanted to get the current date and time as created_at. I have tried all the ways I found on google but nothing works for me. It showing error while running my module. use Magento\Framework\View\...
1
vote
0answers
34 views

Magento 2 warning on select date on frontend

Does anyone encounter this warning when choosing a date, please help me fix it. thank you.
0
votes
1answer
42 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
655 views

Display date in different languages

On our store we have a blog where we show the "created_at" date of the entity. But we show the same post to 5 different languages. Of course the content is translated but we don't know how we should ...
2
votes
1answer
199 views

Set expiry date and save value in table magento 2?

I want to set expiry date for let say store credit, I have created custom column by installschema in table as: { $table = $setup->getConnection()->addColumn( $setup->...
0
votes
2answers
960 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 .
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
1answer
25 views

M2 - Dutch date format

I'm using Magento 2.3.1 and I've installed the Dutch language pack. But the date stays in English like: 08 May 2019 instead of 8 Mei 2019. How can this be changed? The code: <?php echo date('d M ...
0
votes
1answer
685 views

Magento2 order email date formatting

I'm trying to edit email template and format created date. The date in the email is written using this variable {{var order.created_at}} And I think that It is created using the following function ...
1
vote
1answer
138 views

“customer_eav_attribute ” Table what is “input_filter” and what values can you have in there

I See in the customer_eav_attribute table there is a column "input_field", what is that? I see most values are "null2, but i do see "date" and "datetime", what other values can you have?
0
votes
0answers
351 views

Getting PHP Fatal error: Class 'IntlDateFormatter' not found

When I execute the phpunit cases for one of the model, I'm getting the error below, PHP Fatal error: Class 'IntlDateFormatter' not found in /Users/userone/Sites/Magento-CE/vendor/phpunit/phpunit-...
2
votes
1answer
472 views

Magento 2 Admin Grid Date Filter

Using Magento 2.3.1 When admin locale is en_GB it processes dates wrong. For example filtering orders by date. The date pickers work correctly so the 1st May comes out as 1/5/2019 but Magento ...

1
2 3 4 5