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
19 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
0answers
23 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( ...
1
vote
0answers
22 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
0answers
27 views

Magento 2 : update product custom attribute value (type: date) in specific product programatically

I want to update product custom attribute value in specific product which is type date programatically can anyone suggest how to update. I trying below but not success. $date = 31/03/2020; (string) $...
0
votes
0answers
18 views

magento 2 Failed to parse time string

I want to serialize array of date to store in DB while serialize date i am getting error Failed to parse time string, i have tried this if (isset($data['startdate']) && $data['startdate'] ...
0
votes
0answers
27 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 ...
0
votes
0answers
21 views

Magento 2.3 - If the user interface locale is not English then product Date Change after save

I am facing issue in Product Set Product as New From Date. Every time the date is changed after saving the product just because admin user interface locale is not English. Please check the below ...
1
vote
0answers
17 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
16 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. ...
0
votes
0answers
19 views

Magetno 2 - Date format does not render correct

It there is any issue with dateformat tag admin form? I tried so many format but this does not impact on the output. I am getting date in format dd-mm-yyyy but I want format it like mm-dd-yyyy. Any ...
1
vote
1answer
29 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
77 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
17 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
42 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
38 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
12 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 ...
0
votes
0answers
47 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 ...
0
votes
0answers
35 views

Magento 2 Create Date Attribute for Category

I can create date attribute for category but for some reasons date is not saved in database. Please check code and assist me if I am missing any backend model or anything else. app/code/Namespace/...
0
votes
2answers
101 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 ...
0
votes
2answers
380 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
90 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
49 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
66 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
37 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\...
0
votes
0answers
9 views

Facing issue with from date and to date with Central Standard Time (America/Chicago)

I am facing an issue with from date and to date in reports with Central Standard Time (America/Chicago) Locale. I am trying to get the bestseller report after selecting from and to date when I click ...
1
vote
0answers
32 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
0answers
28 views

How to set autocomplete for Magento product attributes?

We have created 2 product attributes called "From" and "To" in Magento Admin, and the type of input for both is a date. How can I set autocomplete off to those date inputs?
0
votes
0answers
27 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
0
votes
0answers
27 views

Magento 1.9 Show Date attribute filter in layered Navigation

How to show date attribute in Layered Navigation Any help would be appreciated. Thanks.
1
vote
1answer
143 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
71 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
269 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
274 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
18 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
218 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
67 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
193 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-...
0
votes
0answers
15 views

Magento2 not formatting date properly on form and grid

I have this form that display a date that can be changed : <field name="date"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"&...
2
votes
1answer
322 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 ...
0
votes
1answer
384 views

I am getting Invalid input datetime format of value '11/22/2018' when setting special price in magento 2.3.1

I am getting Invalid input datetime format of value '11/22/2018' when setting special price in magento 2.3.1.
0
votes
0answers
11 views

Magento2: Option of product : show and select only weeks

I have a date picker attribute for a product. How can I show only the number of the weeks so that the user can select only the weeks? (not the days of the weeks)
0
votes
1answer
48 views

Apply Date Filter With “not qual to” Condition in Magento 2

i need to filter with a date column with not current month records i tried : $start = date('Y-m-d'.' 23:59:59',strtotime('-45 days')); $end = date('Y-m-d'.' 00:00:00'); $collection =...
0
votes
3answers
174 views

How can i add date and month text box with validation(No calender)

How can I add Magento custom validation for month and date text box? These two are input text box user can enter the number and I have to validate it via custom validation. Don't want a calender. <...
0
votes
0answers
129 views

How can i only show date and month select box in calender(Magento 2)

I want my customer edit form calendar to be only date and month and no year and no week days name. This must include leap year as well if a user birthday is on 29th Feb and according to this current ...
0
votes
0answers
43 views

how to change getDateFormat() to only have date and month

So in my Customer edit form, I need to remove year , so on inspecting i found out the script code renders from vendor/magento/framework/View/Element/Html/Date.php code $html .= '<script type="...
0
votes
0answers
53 views

How to filter the date with not this(current) month in magento 2

I have a block with date filters but I want to filter by **not this month (Current month)**records how I can do this???
0
votes
1answer
155 views

Magento 2 Fatal error when adding date field in admin form and save

I am developing a custom module where there are many fields text,select,multiselect..etc in admin form. Today I have added one field in admin of type time ,below is the code to add new field $...
0
votes
1answer
309 views

Magento 2: Admin Order Date filter showing wrong result

I have been trying to filter admin order based on a date but getting the wrong result. I have try to filter Purchase Date from: 03-03-2019 and to: 03-03-2019 Expected result: Filter result ...
2
votes
0answers
28 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
2answers
357 views

Model setData dateTime field set current date

I have an extension attribute for a dateTime field in sales_order table. What I want to do on a certain action is to set the value of this field to NOW(). How can I perform this? $order->setData(...

1 2 3 4 5