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
2 answers
2k views

date displays wrong

I am trying to display a date in the frontend. Currently the code calls the date like so <?php echo $date->date('m-d-Y', $_item->getCreatedTime()); ?> the date in the database is: 2017-...
  • 407
0 votes
1 answer
3k views

Magento Calender with onSelect event

I am trying to capture magento's calender date-select event, haven't found anything about any where, but I already know magento is using jQuery UI calender so I looked into jQuery UI documentation and ...
  • 758
0 votes
1 answer
2k 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.
  • 3,279
0 votes
2 answers
2k views

Date behaves differently in column and form field

Date stored in database: 2014-02-07 00:00:00 Magento Timezone: IST (GMT +5.30) When I display this in column - it displays - 2014-02-07 05:30:00 which is correct and expected (since magento stores ...
0 votes
1 answer
2k 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
1 answer
1k 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( ...
  • 407
0 votes
1 answer
263 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,436
0 votes
2 answers
603 views

Datepicker is not show current date in magento grid module

Here is my code : $not_allowed_date=$fieldset->addField('not_allowed_date', 'date', array( 'name' => 'not_allowed_date', 'label' => Mage::helper('po')->__('Not ...
0 votes
2 answers
721 views

Coupons applying outside of date range and active state

I have some shopping cart price rules set up and want to limit the date range. I have set up my rule to apply a 15% discount on a given SKU, this is working. I have a date range setup from a week ...
0 votes
1 answer
339 views

Change Magento My Order 2.4.4 Date Format

I'm trying to change the date format from 3/6/22 to 03/06/2022 in this file: /app/code/Magento/Sales/view/frontend/templates/order/history.phtml https://imgur.com/jOQNshk How can I edit the following ...
0 votes
1 answer
164 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
2 answers
694 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
1 answer
433 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 ...
0 votes
1 answer
211 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' => [ ...
  • 2,490
0 votes
1 answer
1k 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
1 answer
2k 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( ...
0 votes
1 answer
222 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,581
0 votes
3 answers
1k 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. <...
  • 827
0 votes
1 answer
150 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
2 answers
6k 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 a special price for some products but Special Price From Date and Special Price To Date are not visible. Can someone have an idea how we can add ...
  • 660
0 votes
1 answer
90 views

Change expected delivery date

I display the expected delivery date on our products, using the following line: <?php if (in_array($_product->getData('delivery_eta'), array('2010-01-01 00:00:00','12-31-2099'))):?> I want ...
  • 1,436
0 votes
3 answers
97 views

Date new stock displayed wrong

We load data from our supplier about the date when new stock will arrive. The date is loaded like: 07-12-2016, which is 12 July 2016 and not 7 December 2016. I use following code to load the date: ...
  • 1,436
0 votes
1 answer
4k views

magento 2: How add time to datepicker in backend

I'am using magento 2.0.5 and I want to add date field with time which saves date as well as time in database for entity. I had tried this code to add new field in my module. $fieldset->addField('...
0 votes
3 answers
2k views

How magento stores date in created_at field

I am working on cron extension in which i need to use difference of time. While working on this extension i observed one thing that magento has some difference in time while saving data in the table. ...
0 votes
2 answers
995 views

Disable the Product once timeout ends

we need an option in backend > attributes to set "timeout" for each product. we want to display the timeout in view page. something as below : after the timeout ends, automaticlly Product status ...
0 votes
1 answer
55 views

Add +5 days to getOrderDate()

If I use <?php echo "Valid until: "; echo strtolower(date('j. M. Y', strtotime($this->getPdfHelper()->getOrderDate()." +5 days")))?> I get proper result, but month is displayed in ...
0 votes
6 answers
1k views

Magento 1.9.x Product View > Show Last Order Date

I'd like to show the "date of the last order" on the view.phtml product page. So far I've discovered "getCreatedAtStoreDate" from "design/template/sales/order/history.phtml. But when I include these ...
  • 7
0 votes
1 answer
166 views

Create a pricing calendar - per product

I'm looking to build a pricing calendar for each product (i.e. be able to plan in advance pricing for products). Has anyone had any experience building something like this, or does anyone have any ...
  • 2,896
0 votes
1 answer
783 views

0000-00-00 00:00:00 datetime is showing incorrectly in magento admin grid filter

I am using datetime grid filter in my custom module grid. I use following code- $this->addColumn('created_at', array( 'header' => Mage::helper('po')->__('Created At'), ...
0 votes
2 answers
238 views

Add 7 days to delivery date

I want to add delivery data to order emails which will be 7 days after the order is created. Inside Mage_Sales_Model_Order::getCreatedAtFormated() function, following code returns order created ...
  • 6,827
0 votes
1 answer
79 views

Model _beforeSave observer can't save time

Synopsis I have a date field in my admin form but when I save this date & time, I then have an observer that runs on my model _beforeSave which corrects the format for MySQL. Although in the ...
  • 1,746
0 votes
1 answer
64 views

Sales Reports are a day off

This is a really odd problem that I can't seem to find the answer anywhere - any help would be greatly appreciated. I'm trying to run a sales report by a daily basis however this morning I had this ...
0 votes
1 answer
2k views

Custom model date field did not save current time in table

I have create an model in magento at a custom module and in that model i have create table and that table have a date field and i want save my current date in that date field but it becomes ...
  • 76.5k
0 votes
1 answer
130 views

getDate with day of the week in PDF

In our PDF we display the date of the order with this line: <?php echo $this->getPdfHelper()->getDate()?> public function _getDate($format = 'd-F-Y-H:i') { return date($format, Mage::...
  • 1,436
0 votes
1 answer
30 views

New field in email

I have added a new field in the order process called desired_deliver_date. I can get the value of this field into the email by putting {{var order.getDesiredDeliveryDate()}} However the date ...
  • 2,519
0 votes
1 answer
33 views

How to display the month as a string

I have special offers section in my cart and it has a title of "August Special Offers" at this moment i have hard coded it, but i need a way of the month changing automatically so i do not have to ...
  • 2,205
0 votes
2 answers
3k views

Date format in advanced search

My locale is set to France but the advanced search only works in US format. I've made a custom attribute (date type) and add it to the advanced search. And there are 3 problems: The datepicker (...
0 votes
0 answers
27 views

US date format used in grid date filter

Magento 2.3.5-p2 When filtering the products for creation date for example, its clearly using US date format for filtering. I searched the net, everything I found has either been already deployed to 2....
0 votes
0 answers
82 views

Cart Rule expiration date doesn't save in database

Using Enterprise, I need to get the expiration date of the coupon (the expiration date of the cart rule schedule). The problem is that when saving the schedule, this date is not saved in either the &...
0 votes
2 answers
1k views

Custom Sorting option not working in Magetno 2.4 search

Custom Sorting option not working in Magetno 2.4 search app/code/Arun/NewSorting/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&...
  • 586
0 votes
0 answers
289 views

Magento 2 Add Custom date filter in UI Grid

I have created a custom grid for my custom table. It has a created_at column. Now I want to filter the entries by 7 days, 30 days, 90 days. ie, a dropdown with options 7days, 30 days, 90 days. How do ...
0 votes
1 answer
443 views

Magento 2 Admin Orders Date show not actual result

I have Magento 2.4.2-p1 EE. When i filter orders by dates, example: Purchase Date: 12/12/2021 - 12/12/2021 I have result with 777 found orders. But on last page i can see orders with wrong dates for ...
0 votes
1 answer
239 views

Magento 2.4.x add datetime field in design configuration form using ui component

In Magento 2.4.x, How to add date time field in Content -> Design -> Config-> HtmlHead. I tried the below code it is showing in UI(design_config_form.xml) but it is not saving. <field ...
  • 1,114
0 votes
1 answer
355 views

Magento2.3.4 different hours in REST API call GET Orders and the real order hour timezone

I have selected Timezone (Configuration->General->Locale Options) Central European Standard Time (Europe/Warsaw) Order 10004 has been created at: Sep 21, 2021, 5:59:34 PM When I send API ...
0 votes
1 answer
55 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
2 answers
918 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
0 answers
43 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 ...
  • 3,476
0 votes
4 answers
519 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
1 answer
1k 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
1 answer
347 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 ...