Questions tagged [datetime]

A DateTime object in many programming languages describes a date and a time of day. It can express either an instant in time or a position on a calendar

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

Failed to parse time string, Magento 2

I am getting date value as: $lifetime = date('d/m/Y', $exptime); and saving into custom table. It was working fine untill last working day, I didn't pushed any thing and now I am getting error ...
0
votes
0answers
12 views

Magento 2 How to add time picker on custom form on frontend

I want to add a time picker like the one in the image in a custom form on frontend. Any help would be appreciated.
0
votes
1answer
11 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
11 views

Magento 2 export/import table column as timestamp but populated as datetime 1:5: conversion failed: “” to datetime

Not sure if anyone has faced this issue before where you exported a table then import back but if fails due to created_at and updated_at is populated as datetime where they have been specified as ...
1
vote
2answers
91 views

Magento 2 Data Migration time difference?

We have migrated M1 customers and orders from M2.3.1 successfully with the datamigration tool but we are facing some discrepancy with the time differences. The best example is customer create_at &...
0
votes
0answers
18 views

Invalid input datetime format of value in Others locale

Preconditions (*) 1.Magento 2.3.2 2.Japen or China locale Steps to reproduce (*) 1.Create or edit product 2.Change date field for new from to anything 3.Click Save Expected result (*) Product ...
0
votes
1answer
106 views

How to Add Date with Time in Orders Filter : Magento 2 Admin Section

In M2 Admin I want to filter my orders with date and time, by default date only in purchase filter section. How to add date and time here. Purchase Date with time already show in the order grid!. How ...
0
votes
0answers
26 views

Type DateTime: bad display

I want to create a grid to display hours from a collection. So I add the date column like this: $this->addColumn ( 'date_birthday', array ( 'header' => 'Date of birthday', ...
1
vote
1answer
116 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 ...
0
votes
0answers
33 views

DateTime error on Get Transaction Details request with Authorize.net extension

I am using extension from Authorize.net for payment methods. Everything looks pretty good on testing with sandbox but I am getting errors once launching this extension on live. First everything ...
2
votes
1answer
59 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->...
1
vote
1answer
446 views

Magento 2.3.0: How to add TIMESTAMP_INIT as a default value in declarative schema?

As I'm adding CURRENT_TIMESTAMP as a default value for created_datetime and updated_datetime columns in my database table named faqs, I'm getting both the columns updated while edit the FAQ in admin ...
2
votes
0answers
212 views

Invalid input datetime format of value '1/01/1970'

i am trying to update products and all the products give me the same error and is Invalid input datetime format of value '1/01/1970' can someone help me. thanks
1
vote
1answer
112 views

how to change magento 2 date.js form file

I want to change : magento/module-ui/view/base/web/js/form/element/date.js file and set my custom date file , for this purpose I've added this line to my requirejs-config in my module : 'map': { ...
0
votes
1answer
35 views

How to show current date and time list in dropdown in magento2.1.7?

How to show current date and time list in dropdown in magento2.1.7, As I have purchased an extension for store pickup in my magento2 site.. But the date , time functionality is not working properly, ...
0
votes
0answers
59 views

Magento 2 getting issue in time interval?

I am using amasty one step checkout extension in which delivery date option available. It has delivery time range option only in admin. When I enabled this option then delivery date and time are ...
0
votes
0answers
74 views

Category Date component showing wrong value

I have created a DateTime category attribute schedule_start, I have also created a bakend model for this attribute and before saving attribute value I am formatting the date time value as per the ...
0
votes
1answer
248 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
13 views

PHP set db value according to server datetime

Need to send notification to user by cron. For that there is a datetime picker from which admin can select datetime. IF datetime selected by datepicker is as below: $selecteddate = '26-9-2018 10:00';...
1
vote
2answers
1k views

Magento2 convert UTC time to IST

Can anyone let me know how to change UTC time from table column to IST(Indian Standard time) programatically with Datetime format? I have currently following date time value available in UTC format ...
0
votes
1answer
616 views

How to save local date in custom datetime field

I have been doing this in Magento 1 to save my local date like this: //in my custom controller $data = $this->_filterDateTime($this->getRequest()->getPost('my_name'), array("date")); Now, ...
0
votes
1answer
75 views

Datetime Error on Newsletter Template

Steps to reproduce Go to Admin->Marketing->Newsletter Template Select Queue Newsletter from right dropdown Select a Queue Date Start and try to save it Expected Result Saved Actual result ...
0
votes
1answer
1k views

Magento 2: Filter order collection on “created_at” attribute

I want to filter order collection using 'created_at' attribute but the problem is, values stored in 'created_at' attribute is in this format 2014-03-18 06:57:11 (Combination of date and time) and I ...
0
votes
1answer
50 views

Magento 1.9.2.3

Magento is saving datetime in a wrong format. In form I'm using $dateFormatIso = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); $fieldset->addField('...
0
votes
1answer
136 views

Get store date and time in checkout

I'm creating a shipping module, and I need to get current store time and date at the time. in my requirement, I need to check if the day is Friday or not. Then after that, I need to check if time is ...
0
votes
1answer
377 views

Magento Convert timezone

I have an input array data containing time in 'Y-m-d h:i:s' format and the gmt timezone data like this: $time = array( "time" => "2017-11-01 12:00:12" "gmt" => "+7" ...
3
votes
1answer
920 views

DateTime UI Component - adjust the timezone

I created a time field by the Q&A Magento 2 - How to add the DateTime UI Component, and I also set the store TimeZone is "Asia/Shanghai". But when I click the "Go Today", it always show the time ...
3
votes
2answers
2k views

Invalid input datetime

With my magento 2.1.9 i can not save product, because I have an error: Invalid input datetime format of value '22/09/2017 I think Datepiker reverse month and day, however I have good parameters ...
0
votes
1answer
512 views

Tried to implement the datetime picker magento2, but only date is coming

I have tried to implement datetime picker in Magento2, only date is coming, datetime picker is not appearing, $eavSetup->addAttribute( \Magento\Catalog\Model\Product::ENTITY, ...
0
votes
2answers
209 views

Magento get TimeStamp not working well

I want to display a specific attribute only when the set time is not passed. Therefore I created the following code: <?php $dateFrom = Mage::app()->getLocale()->storeTimeStamp(); $dateTo = $...
0
votes
1answer
425 views

Countdown Timer is not working in magento 2.1.7?

i am use date picker in system config and get date in this format 2015-07-15 i want to convert it into this format 2015-07-15 17:29:31 because Jquery countdown is not work if i insert static value in ...
0
votes
0answers
294 views

Set custom creation timestamp or modify creation timestamp for product

Magento 2.1.1. Is there any way to set custom created_at attribute on newly created product? I used method $product->setCreatedAt($date) before saving it. Value is set on product object, but ...
4
votes
2answers
5k views

Magento 2 Create Date with Time attribute for product [duplicate]

I have tried to create datetime attribute in Magento 2. Below is my script: $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); $eavSetup->removeAttribute(\Magento\Catalog\...
6
votes
1answer
12k views

How to filter collection by date range on Magento 2?

I want to filter collection according : start date < today end date > today I try this but my getSlides() function return empty results <?php namespace Vendor\Module\Block; use Magento\...
0
votes
1answer
2k views

Database dates get stored in local timezone

I'm having trouble with a timezone issue and I'm looking for confirmation. Do dates get stored in the database in UTC. This seems to be th consensus I have found in other posts. For example: If ...
0
votes
2answers
947 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-...
7
votes
7answers
22k views

Convert datetime and timezone to datetime in Magento 2

How to convert datetime with timezone to datetime. I have tried multiple which are available on PHP blog. But nothing worked out. I am retrieving datetime from MySql query as 2017-01-20T13:59:19+03:00 ...
2
votes
1answer
927 views

Create Date Time Instance in Magento 2

How can I create Date time Instance in Magento For example 11-30-2016 5:00:00 pm. remember this should be a datetime variable and not a string variable so that I can do Datetime operations on it.
0
votes
1answer
76 views

How can I specify 0000-00-00 as Year-Month-Date while Save

I want to save a time reference in database which date part should be always 0000-00-00. I have below code with me. $entity = Mage::getModel('my_entity_reference')->load(1); $entity->...
3
votes
2answers
16k views

Magento 2: How to get current date, date time with format in .phtml file?

I already referred Magento 2 Get Current Store Date Time But how to use directly in .phtml file? Can able to get Date, DateTime & Also able to set it's format?
1
vote
0answers
239 views

Magento Timezone Wrong

I can't seem to work out whats going on with my Magento timezones. All my orders in the backend are processed correctly and have the correct times. The backend reports however are out by 13hrs. I've ...
0
votes
1answer
26 views

Files and Folders - all new created or changed show dates one hour after system time!

This is Magento 1.9.2.4. Here is the current situation: Server time is correctly set up. I can check it from Terminal. PHP time is correctly set up as timezone. I created a php file for showing the ...
1
vote
1answer
108 views

How can i create own order Time Countdown for EVERY ORDER

I need to create time Countdown for every order, which is used to priority to my pending order. If order complete stop the countdown. and how can I share my new order mail to multiple email addresses?...
19
votes
2answers
10k views

Magento 2 - How to add the DateTime UI Component

I want to add new field as datetime in CMS page section while adding new page, I found that magento using UI Component for it, so after digging I could able to add the date field by using below code ...
11
votes
2answers
4k views

create date and time attribute for product in magento 2

I tried to create an attribute for product which has to be display date and time calender and that should be stored in database as date and time formate only.I struggled it for a lot but no luck.Can ...
0
votes
0answers
34 views

Catalog Price Rule to the minute

I have set up a Catalog Price Rule for all products and I can set a start and end date but what about the time? Is there a way that I can add the time to the end date?
3
votes
1answer
5k views

Magento 2 backend form date time form field

How can I get datetime as form field.I have used below code able to select date but there is no time. How can I get time also as input field. $fieldset->addField( 'time', '...
0
votes
0answers
430 views

Datetime render issue on Magento admin grid

In our Magento EE dashboard sometimes DateTime column of grids (orders, customer orders) showing incorrect values, this only sometimes, not all times. Maybe it depends on the session, maybe it has the ...
0
votes
2answers
1k views

Magento 1 - Change Magento custom options date values

Hello I am simply trying to find the array of defaults for the product custom-option date my goal is to change the month from "01,02,03....12" to a string with the month name "Jan. , Feb. , Mar. - ...