Hot answers tagged

11 votes
Accepted

Magento 2 Show timepicker using UiComponent not Datepicker

You need to "create"* your own UI Component. You can do this by extending the Date UI Component. #1 Add the XML to your form Add the field to the fieldset. In this example, the component that we ...
bassplayer7's user avatar
  • 2,186
11 votes
Accepted

UI component - display the time to 'Y-m-d H:i:s' format(ISO time format)

Try to change the dateFormat value of your column: <column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date"> <argument name="data" xsi:type="array"> <...
Siarhey Uchukhlebau's user avatar
11 votes
Accepted

magento 2 - getCreatedAt() returns UTC time and not local time

You can use an instance of Timezone to convert it into store's timezone. Here is a very generic example. namespace VendorName\ModuleName\MyDir; class MyClass { private $timezone; public ...
Maruti N. Sharma's user avatar
6 votes

Soap API - How to get request by Limit 10 based on pagination?

Unfortunately as far as I know you can't simply pass a limit to the SOAP API. One approach which would work if you don't need to filter the list by any attributes, want to get all attributes and ...
HelgeB's user avatar
  • 4,501
5 votes

UI component - display the time to 'Y-m-d H:i:s' format(ISO time format)

You need to add date format dateFormat value of the column as YYYY-MM-dd hh:mm:ss, the ICU date time format. Take a look at below link for more detail: http://userguide.icu-project.org/formatparse/...
Ashish Raj's user avatar
  • 1,325
4 votes
Accepted

How to set default value for configuration field with type time

Try this format: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <...
Siarhey Uchukhlebau's user avatar
4 votes

Adding the Now date/time format in Magento

Here are some additional examples for you on how to use methods built into Magento. $now = Mage::getModel('core/date')->gmtDate(); // 2016-05-15 19:05:15 $full = Mage::helper('core')->...
Shawn Abramson's user avatar
4 votes
Accepted

Database dates get stored in local timezone

Try this one to check the actual date and time as it is configured in your Magento $time = Mage::getModel('core/date')->timestamp(time()); $now = date('Y-m-d h:i:s', $time); echo $now;
PЯINCƎ's user avatar
  • 11.6k
4 votes

Magento 2 Show timepicker using UiComponent not Datepicker

You can just use this xml code for the same result as above: <field name="opening_time"> <argument name="data" xsi:type="array"> <item name=&...
Sergey Uskov's user avatar
3 votes
Accepted

Magento2 not getting current time

$objDate = $objectManager->create('Magento\Framework\Stdlib\DateTime\Timezone'); $currentTime = $objDate->formatDatetime(date("Y-m-d H:i:s")); $currentTimestamp = strtotime($objDate->...
Naveenbos's user avatar
  • 1,226
3 votes
Accepted

caching topmenu.phtml

If this is the default catalog.topnav block and an instance of Mage_Page_Block_Html_Topmenu, it's already cached for unlimited time (or until any category changes, thanks to cache tags). This is ...
Fabian Schmengler's user avatar
3 votes

Magento2 - Order timestamp not correct

As in Mohammad Rashid Hussain answer, it is a bug in magento 2 core. One option is to fix it in magento core setup as mentioned in that answer. Another option is to fix the problem in a custom ...
Korbin's user avatar
  • 298
3 votes

Magento 2 datatypes. Need TIME (of day)

I solved this by using DATETIME initially $table = $installer->getConnection() ->newTable($installer->getTable('MYTABLE')) ->addColumn( 'MYCOLUMN', ...
Kampaviineri's user avatar
2 votes

What is the suggested value of max_execution_time and memory_limit for 20,000 products site for Bulk export

It depends on so many factors. A production server setting of 300 seconds is ideal, but that depends on the setup. In any case, PHP execution should not exceed 600 (seconds), in general (as mentioned ...
Mohit Kumar Arora's user avatar
2 votes

How to Expire Link after 10 min

You can generate a link with param attached to it. This param can be a timestamp or token. 1. Approach with timestamp Your page link in email would be something like <a href="https://your-site/...
Abdul Pathan's user avatar
  • 2,802
1 vote

Magento 2, Time is incorrect in Admin Grid

Change the timezone in the locale settings for the default scope - https://docs.magento.com/user-guide/stores/locale-options.html Later edit It just occurred to me that this has to do with the way ...
Diana's user avatar
  • 5,097
1 vote

How to Expire Link after 10 min

I can suggest a solution using cache lifetime (10 minutes), save your token_key into cache service with 10 minutes is cache lifetime, if you can't get your token_key on the cache system, that means ...
HoangHieu's user avatar
  • 1,348
1 vote

How to Expire Link after 10 min

If you are saving data in the database than save current time and then compare that time and date. if you are not saving it then pass date and time in parameters and compare it with current time date. ...
Nilesh Dubey's user avatar
  • 1,067
1 vote

How to Expire Link after 10 min

Unorthodox solution just for fun :) You mentioned that you're sending inside controller: namespace MyCompany\MyModule\Controller\Token; use Magento\Framework\App\Action\Context; use Magento\Framework\...
Roman Kabanov's user avatar
1 vote

Soap API - How to get request by Limit 10 based on pagination?

<?php defined('BASEPATH') OR exit('No direct script access allowed'); error_reporting(-1); ini_set('display_errors', 'On'); class Live_stock extends CI_Controller { public function index() { ...
Rakesh Donga's user avatar
  • 5,344
1 vote

How to set default value for configuration field with type time

Step 1 : create file in this location for creating configuration fields – app/code///etc/adminhtml/system.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
Chirag Patel's user avatar
  • 6,116
1 vote

How to make customers to stop placing order after shop closing time in magento1.9?

You can use sales_order_place_before event to stop placing order after a specific time. In your config (this is part of config.xml) <config> <frontend> <events> ...
Vishal Thakur's user avatar
1 vote

Need to Change the timer

Check by enabling Template path hint in Magento, you will get from which file that clock and text is coming. If then also you are unable to find then check in which cms page it's coming as there can ...
Amrit Pal Singh's user avatar
1 vote
Accepted

Magento related, can I change the cron job time interval with something new from my database?

You can create a system configuration text field via system.xml and use it as your cron schedule: <crontab> <jobs> <test> <schedule> &...
Raphael at Digital Pianism's user avatar
1 vote
Accepted

magento 2: How add time to datepicker in backend

You want to have the declaration of the field similar to the following; $fieldset->addField( 'date_to', 'date', [ 'name' => 'date_to', 'label' => __('Start Time'),...
Smartie's user avatar
  • 3,240
1 vote
Accepted

Adding the Now date/time format in Magento

You can use below code to format date: <?php $dateTimestamp = Mage::getModel('core/date')->timestamp(strtotime($rma['created_time'])); echo date('F j, Y g:i a', $dateTimestamp); ?>
Prashant Valanda's user avatar
1 vote

Magento 2 datatypes. Need TIME (of day)

Magento ORM does not implement exotic date types. You have two options: Rewrite every single DDL class in Magento 2.0 Framework and introduce a headache to maintain it with every new release of ...
Ivan Chepurnyi's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible