Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

[CUSTOM] PHP-Fusion Time/Date Settings

I could not think of a better place to fit this but this forum, so I will let it here.


If 24 hour (military) time has ever annoyed you, or that the day of the week did not show, I am here to answer your questions.

The article on http://www.php.net does not follow the same functions as PHP-Fusions time settings.

Below, are a list of some I have made in an article on my site I will copy over but not format.
If you wish to see the formatted version with some examples, you can check it out here: http://whiteyslair.com/articles.php?article_id=1
(Note that my site is under heavy construction. You will see things come and go, but if you wish to register, sobeit.)

Good luck!

Month


%B - Displays the month in full format. e.g. March, April, etc.
%b - Displays the month in short format. e.g. Mar, Apr, etc.
%m - Displays the numerical month with beginning 0's. e.g. 01, 02, etc.


Day


%A - Displays the day of the week in full format. e.g. Saturday, Sunday, etc.
%a - Displays the day of the week in short format. e.g. Sat, Sun, etc.
%d - Displays the numerical day of the week with a beginning 0. e.g. 01, 02, 03..28, 29, 30, etc.
%D - Displays the numerical day of the week with beginning 0's in full format. e.g. 01/01/14


Year


%Y - Displays the year in full format. e.g. 2014, 2015, etc.
%y - Displays the year in short format. e.g. 14, 15, etc.


Hours


%I - Displays the 12hour-hour with beginning 0's. e.g.. 12, 01, 02, etc.
%e - Displays the 12hour-hour with NO beginning 0's. e.g.. 12, 1, 2, etc.
%H - Displays the 24hour-hour. e.g. 00, 01, etc.


Minutes


%M - Displays the minutes in numerical format. e.g. 01, 02, etc.
(This is the only way to display minutes. There's literally no other way; that's be pretty silly otherwise.)


Seconds


%S - Displays the seconds in numerical format. e.g. 01, 02, etc.
(This is the only way to display seconds. There's literally no other way; that's be pretty silly otherwise.)

Additions


%p - Displays whether it is AM or PM in capitals.
%P - Displays whether it is Am or Pm with shifted initials.
%Z - Displays timezone in letter format. e.g. EST, PST, etc.
%z - Displays timezone in numerical format. e.g. -0500, -0300, etc.

Shortcodes


%r - Displays time in full 12hour format. e.g. 01:25:02 AM
%R - Displays time in full 24hour format, with NO seconds. e.g. 00:25 (I believe so, anyway.)
%T - Displays time in full 24hour format, WITH seconds. e.g. 00:25:59 (I believe so, anyway.)
%D or %x - Displays date in full two-digit numerical format. e.g. 01/01/14
%F - Displays date in full, backwards numerical format. e.g. 2014-01-01
%c - Displays date and time, in short format, with full year. e.g. Sat Mar 1 01:25:00 2014
So what are the discrepancies you say exist in PHP-Fusion?

Quote

Richard Ainz wrote:

So what are the discrepancies you say exist in PHP-Fusion?


When did I ever mention a "discrepancy" within the PHP-Fusion CMS?
Accept my sincere apologies in trying to assist everyone in trying to customize their website with the correct information.

http://us2.php.net/manual/en/function.date.php
I am going to have to take into account that the above is based off an outdated documentation, because almost 70% of the items on that page either
  1. Do not work
  2. Have incorrect descriptions and results


Do tell me where the word "discrepancies" and "PHP-Fusion" ever met in the same sentence; and I will be more than glad to allow you to intrigue me with further assumptions. I spent too much time figuring out what each function did and writing it down, and for you to sit here and act belligerent about my findings is egotistical.
Well you said it did not follow the same functions, that is the just another word for discrepancies but I get your explanation.
@Whitey Thank you for making the effort to make this.

Quote


I am going to have to take into account that the above is based off an outdated documentation, because almost 70% of the items on that page either

Do not work
Have incorrect descriptions and results


Domi and I discovered this thread few hours ago. We discussed. I was to check. I am yet to check on this. I did a simple test to showdate() and date(). Yes they have discrepancies.

In my code:
CodeDownload  

".date("M d, Y", time())."<span>".date("D h:m a", time())."



and

CodeDownload  

".showdate("%M %d, %Y", time())."<span>".showdate("%D %h:%m %a", time())."



Both produce different results. It will be in my todo to look into showdate soon. It is not that showdate is badly coded. No, it's an issue of standardization if I get your point correctly Whitey. I will consolidate it once again using your reference.
@Whitey, thank you for this excellent post. I ran into the same issue this weekend working on a project. I found this link that may be useful to everyone. PHP-Fusion Date/Time Usage. It seems to be a guide written by Netrix posted over two years ago.

@hien, PERSONALLY, I do not think they should be the same as PHP.net, and here is why. I know for a fact that Nick Jones knew the differences being discussed here, leading me to believe he coded the DISCREPANCIES on purpose. My speculation is that he knew people would be using PHP-Fusion to learn how to program, thus he created a UNIQUE environment. It is no different than him creating unique database call functions, or unique security features, or whatever. The time and date usage is UNIQUE to this environment.

Also, having known Nick about ten years ago, and having worked with him on a few of his development projects, I know that he knew the importance of change when learning something new, as in, if things never change, learning ceases to exist. This situation of the date/time function being different should be recognized not as "an issue of standardization", but as an opportunity to expand ones knowledge by seeing a part of programming, and PHP-Fusion, from a different perspective. If we honestly break it down, can we not say that is what makes a programmer a programmer, the ability to see things from perspectives that others do not. The DISCREPANCIES he created reinforce this shift in perspective.

@Richard, It interests me HIGHLY that a person who owns not ONE, not TWO, not THREE, but FOUR php-fusion sites, one of which is a NSS, does not know about the DISCREPANCIES between PHP-Fusion and the normal PHP date and time functions. If you're going to flaunt, you should at least get a clue as to what your flaunting.

Quote

@Richard, It interests me HIGHLY that a person who owns not ONE, not TWO, not THREE, but FOUR php-fusion sites, one of which is a NSS, does not know about the DISCREPANCIES between PHP-Fusion and the normal PHP date and time functions. If you're going to flaunt, you should at least get a clue as to what your flaunting.


I own many more sites than that. It is very simple, never had reason to look in to it until very recently. Always used standard settings or modified as possible in the interface. I am NOT a coder or developer in the general sense of the word, never claimed to be and I mostly use PHP-Fusion out of the box with few changes or additions but for Themes.
@Brandon. We come from and will still remain with simplicity. That is promised. Our job at dev is to extend the feature or reconsolidate flaws while maintaining backwards compatibility. Rest assured I am not changing our perspective rather than looking into these discrepancies aforesaid and implement everything we have based on Guides/issues/ (Netrix or Whiteys) in said issue if possible in a manner derive out of most logical sense, thorough discussions, experiment, testing, feedback. I did rolled back a few roadmap even I completed myself. So don't panic. I'm not applying A fix if there is no flaw. If I apply something that sets all infusions incompatible, let's not discuss this, that's not gonna happen under my watch.

Well, it is interesting to see how we can perceive things. Let's not make judgement about people here guys. Richard were to in fact enquirer as to the issue the way word was put up. discrepancies means "difference" . To me it doesn't carry weight at least.. And difference, Yes, according to my initial test....as I just mere echo and will report back when I find the reason "why" and "how" when I study them. I am about to.. Maybe tomorrow when I do I probably can give Richard the answer how.

Guys, We are suppose to answer if someone doesn't understand. It has really nothing to do whether one owns more than one website. The issue is still date and time here.. Stick to it. Lol.
We are not. Nick. But he is a brilliant coder. We aim to surpass, together. So thanks Brandon, I agree. Nevertheless, my judgement is still going to be based on how we do things from the dev protocol.. Change without repercussion , and for the better result.

I appreciate the tolerances guys, and good feedback.
The initial answer by Polarfox is correct.

The inputs are parsed by the strftime function and not time / mktime nor date.

Merged on Mar 04 2014 at 17:57:15:
For further information we have this as a sticky here :
http://www.php-fusion.co.uk/forum/vie...d_id=27996

Due to that fact this thread will be [ LOCKED ]
Thread Information
Author
Replies
10 posts
Views
4,557 times
Last Post
Last updated on 7 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Falk, PeaceLaced, Homdax, Chan, PolarFox, Whitey