PHP Classes

PHP Real Time Hour Class: Get the real time according to the day of the year

Recommend this page to a friend!
  Info   Example   Demos   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 64 All time: 10,406 This week: 73Up
Version License PHP version Categories
realhour-class 0.1GNU General Publi...5PHP 5, Time and Date
Description 

Author

This package can get real-time according to the day of the year.

It checks the current server time to determine if the current season is summer or winter.

The package can also take a date and time and format string and returns the current formatted date and time after adjusting the time depending on the year's season.

Innovation Award
PHP Programming Innovation award nominee
April 2023
Number 3
PHP has several functions to get and format the current day and time.

These functions use server time epoch number, the number of seconds that have passed since January 1, 1970.

To format the current time and date as a string, PHP may need to consider daylight savings time adjustments that happen in many countries when seasons change.

If PHP is not configured to make this daylight savings adjustment, developers must adjust that time in their code.

This package can make those adjustments according to the current day of the year.

Manuel Lemos
Picture of Pierre FAUQUE
  Performance   Level  
Name: Pierre FAUQUE <contact>
Classes: 18 packages by
Country: France France
Age: 77
All time rank: 15212 in France France
Week rank: 50 Up4 in France France Up
Innovation award
Innovation award
Nominee: 12x

Winner: 1x

Example

<?php
require("class.realhour.php");
$h = new realhour();
?><!DOCTYPE html>
<html>

<head>

  <meta name="author" content="Pierre FAUQUE, pierre@fauque.net">
  <title>Test: class.realhour.php</title>

  <style type="text/css">
    body { margin-left:2em; margin-top:2em; }
    h1 { font-family:times; font-size:20pt; font-style:italic; color:#000080; }
  </style>

</head>

<body>

<h1>Demonstartion of the realhour Class</h1>

<?php
echo "At this very moment we are on :<br/>&nbsp;<br/>\n";

echo
"&mdash; ".$h->now("m/d/Y H:i:s")." (Standard English writing)<br/>\n";
echo
"&mdash; ".$h->now("m/d/Y \a\\t H:i:s")." (English writing)<br/>&nbsp;<br/>\n";

echo
"&mdash; ".$h->now()." (Standard French writing)<br/>\n";
echo
"&mdash; ".$h->now("d/m/Y ? H:i:s")." (French writing)<br/>\n";
?>

</body>

</html>


Details

Sun, 02 apr 2023 17:30:00 +0100 realhour Class: version 0.1 du 16/03/2023 MD5 of the Class: 76F0521F0F6A1BDF2CAAD1CFBF4AF89B Documentation: included in the class URL du site: http://www.fauque.fr Menu: Divers / T?l?chargements / Classes PHP Twitter: http://twitter.com/fr_phpuser hashtag: #RHOUR Author: Pierre FAUQUE, pierre@fauque.net Public PGP key's author: 0xBB599B65F8CC4747 (long key ID) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQINBEs9tXQBEACuoUiyx3ISCGUxu9DwACKe0jSRhy/fs4spUmVgw/ePNhUuIX8r RoljTWnL04kTNihI8L8PW0kA1IT5SURJ+5OXp0sMXZ9vEnk/TZwRjB+sGQPfWONJ CDldBTX0bw+CUB8URiarlhfbU4+3usJ8SlGQBXaHlWCgRaBDy0x8qADayWnxB3ip O865LyYhh9y+Ru/ECHC/+nFMazlv5ezP6vG4nHZEEgdcr8Q9OoWkr2Qw6Y/fvgH7 j8G/hlaMnhMv9T8K7OTKoyvlrXtw7AvH+xDIT/QEKeiPjb5IDUna8WtDZHCKQTps s6xBypmX41wE4iO1LqlpXB1Va4yya8bsHWovBri2ZhQzIxUU1JFPHgOcmtiNmnGD Y2DnHQchJtC8Zi84kU7EMl+27YghC0ViPXth8O6tySU6UcRCTKhLFkqI4PxWwDex g2mztd0+H2p4XrSV07lteJqnrNDZJHAxCKZywijU7YSfS9c1iau3Iv+26+F430dg JRrEyIV7BX5/BEcPIrrQda5XpqKtxKGomTd/KeT51LpBpMJgmAIgA4AZ3XNUntfN G4NY2ZtEMgI2b7xd8qVEuMZYWyDiVIcJuy3BpJkN+AbEHjyq75oXUps+2aCq9MN+ 9GtP0yPskfZ/BJJyfbjuVtKY6oxR4VV6KPR+Kx4OUDjLQiqEwEp03/hdZwARAQAB tCFQaWVycmUgRkFVUVVFIDxwaWVycmVAZmF1cXVlLm5ldD6JAhwEEwECAAYFAks9 tbsACgkQu1mbZfjMR0cLJhAAkgyo8iTfYt9TNBigtVDci+UVuyvFw20H/VWkSp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MFxqTAJqhqj6 5cARAadjVzIkYVacudYdmZxQM7pdSQ9jyKfFbF8j3lrkoHuuynWlfq8iuut1J24c IK1A75IHClGLQ6CSC+cPXRaAZ42o15W3xrpv9MIKZEMumFuqGx1bZVtbPyO2fF29 HJHQMIPcU/C/8b89ArtjB+wHwRlQU4/yV6E09wbSYGLWANkqb5tFu5MCjwdXzvVK Hf74615xZBmeQlHEeDw6Sr86ipCAamss2Tm23mL5oyW2EliC4aWO++24imK9ABEB AAGJAiUEGAECAA8FAks9tbsCGwwFCQAAAAAACgkQu1mbZfjMR0eIqBAAmxHToHww ewGEJtiQC5vT9aW81MLlsKl7xNlnt9XFVe+b8+cM+IlVgS+tCo0ZynvB71ncEbKH cuI+wTYvJcxL+F0frP4cjKy51pMU0nQKlh8qKlqw+SIRr5HONV4f1ml7cGu+T2c0 3MEcDzYezsB/7DXj15GCJs94gkV3vCVbqXSLq5rlTrH8EL7yETvoP4swmKO3e2+Z UsCaOreDH8JABSGVnlLUh2YoC5VjnGYhPIQp4n3v418lxWi0FTlG0oKH4dBsat+r TYLf/yD1Gzmb8oBB3k5XusXMmpi0MnuoiTWeKWrHRr9IEW5OOZlc4XiAhqbYN7rx r9guaapuok7BrB4LIVswzdv+FYzJ2fsYgguyZduYDbgFDD2MLtxQwgTj6r1MQSjl cA4wzJcc9tt272Fk2+0Hsj6+xkF8uTEZqtyRFG8Lrl8N1v2UPxZ4I05HuclzOWkb eX0w/84yxldMda3gir3wVVPcyx1ku03IXUlwEDP2zla4Gn+DDJShA9OcjtKsPpQ4 twINN1jgsxNeOVWfgP+4aeBNIwGNWm54Sx9SdBS2gxNXOVcvvg1WUPV1LbcnmYpk da9AdRKfbq7srHX9uH9Lxy7PoSpq0AneU8Eu3IYqKKaA6nJQxQ5JPeliQCpfMq/Z SCf1qW/pIWu0HsKsLm1IOXb4xjpEH9QhMpc= =SHbA -----END PGP PUBLIC KEY BLOCK-----

  Demo on the author's websiteExternal page  
  Files folder image Files (3)  
File Role Description
Plain text file class.reealhour.php Class Main class
Accessible without login Plain text file realhour_test.php Example Example of use
Accessible without login Plain text file README.txt Data Infos about Class and author

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:64
This week:0
All time:10,406
This week:73Up