Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [date]

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

0
votes
0answers
8 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
34 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
0answers
29 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
10 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
16 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
86 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
20 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
19 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
17 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
55 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
0answers
53 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
24 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
109 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(...
0
votes
0answers
38 views

Magento 1.9: How do we provide a filter for date range on the Magento front end?

We recently moved our site over to Magento 1.9. We provide recorded audios and videos through our store, both for sale and via a membership. Our customers frequently want to filter results by the ...
0
votes
0answers
29 views

Date / time format in Magento 1.9x

I am sending and retrieving data from the Magento 1.9x SOAP web service (v2). My question is which format are date / time fields passed in the SOAP api? Also, which timezone are dates processed in the ...
0
votes
0answers
17 views

Compare date of productstock not working in Magento 1.9

I currently use the following code, to check if the $productEta is in the future, based on the date of today. But that is not working well. Its a dynamic code, so I will provide the entire code: $...
1
vote
0answers
84 views

Magento 2 Ui Component Date Field Saves current date

Magento 2 Ui component Date Fields save the current date not saved the inputed date please show my below code Form <field name="active_from_date" formElement="date"> <argument name=...
0
votes
0answers
96 views

Schedule CMS block content change on a specific date

We have a CMS block on our front page and we would like to automatically change the content of it on Black Friday, for example. How could we do this?
0
votes
1answer
32 views

setCreatedAt Is not working

From the following script below, I dynamically add evaluations on the products, however I am not able to set the creation date from $review->setCreatedAt($data_avaliacao);. I already researched the ...
0
votes
1answer
113 views

Magento2 set timezone with mysql query

I am trying to get days difference between 2 dates with mysql query with DATEDIFF function for production_days column: $collection->getSelect()->joinLeft(array('cvo' => 'cp_vendor_order'), "...
1
vote
0answers
18 views

How to disable previous date for custom attribute in magento 2?

Step 1 : Add below input field whereever you need in .phtml file <div class="field street"> <label for="date_field" class="label"><span><?= /* @escapeNotVerified */ __(...
0
votes
0answers
27 views

Magento 1.9.2. - Dashboard: Add each month as a date range of current year in the order report

Now I have the standard Magento filters but I would like to see the reports of orders of every single month of the current year. I tried to edit function public function getChartUrl() in Graph.php, ...
0
votes
1answer
364 views

Magento 2 how to remove special price if special price date has expired

I am facing issue in Magento 2.1.7 If special price date has expired for any products , i want to remove special price and special price to date and special price from date form products, by using ...
0
votes
0answers
836 views

Special Price From Date and Special Price To Date not visible in backend M2

I am working on Magento Enterprise 2.2.5, I want to set special price for some products but Special Price From Date and Special Price To Date is not visible. Can someone have idea how we can add these ...
1
vote
0answers
231 views

Magento2: Add date-from validation for dob (date of birth) field in customer creation

I want to limit the dob field in account creation form to be not less than 01/01/1900. I thought 2 way: - limit the calendar widget (but maybe someone could input the date directly) - add a ...
0
votes
0answers
183 views

create custom date field with calendar in Magento2

I created Custom customer attribute: <div class="field"> <label for="customdate" class="label"><span><?php /* @escapeNotVerified */ echo __('Custom Date') ?></span>&...
0
votes
0answers
28 views

Magento 2 How to add Delivery date function in both admin and frontend

In magento 2 I need to add Delivery date option in both frontend page and admin page. Is it possible to update by the code?
0
votes
0answers
36 views

date of birth value doesn't show up in account information in admin panel on magento 1.9

I am trying to fetch the date of birth of end user but i show there no date of birth enter or saved in admin. <div class="dob-full" style="display:none;"> <input type="hidden" id="<?...
2
votes
0answers
43 views

Magento : How to Solve Fatal Error SetDateRange() [closed]

When I try to filtering report by date range in admin, It show me error like this. Fatal error: Call to a member function setDateRange() on boolean in app/code/core/Mage/Reports/Model/Report.php ...
0
votes
0answers
44 views

Saved date of birth value doesn't show up in account information

I have set up my store using Magento-1.9 and I have set the date of birth field in my store mandatory. My problem is whenever someone enters the date of birth value and saves it, it gets saved, and ...
0
votes
0answers
86 views

How to set Shipping date and Invoice date of specific order programatically

I have created a script to import order programmatically and it runs successfully but only issue is I am not able to set Invoice and shipment date as my CSV it will always save the current date in ...
0
votes
1answer
28 views

The custom function is returning error when added in a controller

I have a custom function in a controller file, the function basically is to be used for converting the time into a different custom format, for example, if the time is indicating the date of yesterday,...
1
vote
3answers
1k 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 ...
0
votes
1answer
486 views

Convert Datetime to Date

I am having trouble pulling the date out of a datetime in magento. Currently the date gets called using: $_formatDate = Mage::app()->getLocale()->getDateTimeFormat( ...
2
votes
1answer
1k 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?
1
vote
3answers
395 views

Collection filter date range not working

I tried to find the collection that has a range created between 4 hours, but somehow it doesnt show the right collection size, it always returns '0', here's how i use the filter: $to = date('Y-m-d H:...
1
vote
2answers
181 views

Changing Date in Magento 2

How can I change the date in magento 2? Not the format, but the date. For example, I want to post some article with the date of a week ago, like 20 march. How can I do this? I have searched for it ...
0
votes
1answer
83 views

How add current date and text

Need to add today date and 2020096 in 'number' => $consignmentNo, so it will be 201803222020096$consignmentNo $tracks = array( '1'=>array( 'carrier_code' => $carrier_code, ...
1
vote
1answer
78 views

Adding future date/time to TrustPilot script in Magento Packing Slip

I am about to add a "Structured Data Snippet" to my Magento packing slip emails, which should include a future date. The snippet looks like this (example data): <script type="application/json+...
1
vote
1answer
71 views

How to get CMS block ids between dates?

Going forward with my customization I would like to get CMS blocks using a filter: My code to get the collection: $today = Mage::getModel( 'core/date' )->date( "Y-m-d" ); $collection = ...
0
votes
1answer
474 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
1answer
35 views

Change layout var date email

Inside a transactional email whe print a date attribute, using the following code: {{var quote.followup}} This only displays the date as 2017-12-11 00:00:00 How can I change that into Mondag 11 ...
3
votes
1answer
1k 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 ...
1
vote
2answers
52 views

Magento display date into multi values

I load the following code: <?php if (isset($item['delivery_eta'])): ?> <?php $date = DateTime::createFromFormat('m-d-Y', $item['delivery_eta']); if (!$date) { $date = DateTime::...
4
votes
1answer
2k 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
1answer
79 views

php date always displayed in Dutch [duplicate]

I currently use the following code to display some date inside my Magento store: setlocale(LC_TIME, 'nl_NL'); $today = new Zend_Date($_product->getData('delivery_eta'), 'MM-dd-yyyy'); $date = ...
1
vote
1answer
548 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
2answers
1k 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
2answers
144 views

one month previous day in magento

I want new date from current date, difference of 30 days. $dt = date("Y/m/j",strtotime("-1 month")); and $firstDayOfPrevMonth = date("01.m.Y", Mage::getModel('core/date')->timestamp(strtotime('...
1
vote
0answers
69 views

Magento 2: Send email based on timezone selected by customer

I am developing extension in which I need to send email on base of selected Timezone by the customer. I have set a cron which is working fine, however, I confused about to send email on the base of ...