CakePHP 3 display the wrong date format - cakephp

This date format 2016-04-21 is stored in the database, but it's display like 21.04.2014. on my website. This is very frustrating.
Solution echo $object->field->format('Y-m-d'); is not good for me.
I would like to define settings that this is not happening anymore.
Sorry for my english.

Use this
$date="2016-04-21";
$require_date_format = date('d.m.Y', strtotime($date));//will out put 21.04.2016

Related

AngularJS Issue With time Input Formatting

I am fairly new to AngularJS and am having an issue with formatting the time object to populate my "time" input field in Android and Firefox. I have spent hours trying to figure out the issue and also utilized AngularJS's documentation to try and figure this out, but have had no luck.
I am dynamically populating an input field from JSON, and the result is always in the following format: 14:57:00.000
I need it to look like this in the input field: 2:57 PM
Here is the link to AngularJS that I have been referring to: AngularJS time input. At the bottom of the page is the plunker to run.
Thank you in advance for any assistance you can provide me.
you can use something like this
{{myTime | date: 'shortTime'}}

How to properly format wordpress post date in ionic angularjs

I am working on a news blog mobile app using wordpress WP-API, everything else is working ok, but am having problem formatting the wordpress post date
this {{post.date}} gives me something like2016-08-07T15:45:26
How ever I want to format the date to have something like dd-mm-year, then in another one I get the time, instead of 15:45:26, I want to get something like 3:45 pm.
If possible, I will also like a filter that returns the date 2016-08-07T15:45:26 to something like 24 hours ago, 2 days ago, 1 week ago etc
Thanks
Had the same problem too. You may want to check this
:https://weblog.west-wind.com/posts/2014/jan/06/javascript-json-date-parsing-and-real-dates
You could use a date manipulation library to convert the datetime provided by WordPress to the desired format. You may want to check out Moment.js.

How to change x-axis datetime format in QlikView

First time Qlikview user here. Trying to get x-axis only showing the date from the timestamp. Here is the example,
It would be lovely to be able to remove the time. Does anybody know how to do this? I tried some simple script in the Used Dimension section under Dimension tab hoping to get only the date. It didn't work. It looked like this:
=date(floor(timestamp#(SomeDate,'MM/DD/YYYY hh:mm:ss'))) as record_date
Please help!
If you need to remove time than you rather use Date# function instead of timestamp#?
Below one is the sample one:-
Date#( DateField, 'M/D/YY')

Dojo Calendar is only showing numbers instead of month names

I currently have a problem with Dojo's calendar. It doesn't seem to be showing the name of the month when the locale is switched to zh-tw.
Instead of getting:
一月
二月
三月
。。。
we get
1
2
3
...
We don't have this problem when Dojo the locale is set to en. This is somewhat related to https://bugs.dojotoolkit.org/ticket/10490.
Anyone have a clue as to how to fix this? :)
Thanks!
That's because they implemented it that way. You can look at the source code and see that the months are numbered. You can even compare it to the English version.
As far as I know there is no way to extend or override this, so you will have to extend the dijit.Calendar._MonthDropDown yourself and hardcode it (not that this is a best practice).

regex for time 24 hour format in extjs 3

I am little weak in regular expression. Can anybody help me in finding regular expression for time (in 24 hour format) in extjs
Thank you.
Don't reinvent the wheel if you don't have to. The fine folks at Sencha went through a lot of trouble so that developers like us don't have to mess with this sort of thing.
// returns null if parse failed, or Date object is successful
var mydate = Ext.Date.parse(inputString, "G:i");
For more information, check the API docs for Ext.Date
This might be what you are looking for:
'/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/'
Not sure if it works on extis, if not you can always translate it back to the syntax uses in extis.
Try out
^(20|21|22|23|[01]\d|\d)(([:][0-5]\d){1,2})$
or you can use
([01]?[0-9]|2[0-3]):[0-5][0-9]
For more info visit tutorial

Resources