Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"karelwintersky/monolog-pdo-handler": "^0.2.0",
"monolog/monolog": "^2.0",
"apache/log4php": "^2.3",
"whichbrowser/parser": "^2.0"
"whichbrowser/parser": "^2.0",
"nesbot/carbon": "^2.35"
},
"require-dev": {
"phpunit/phpunit": "8"
Expand Down
37 changes: 37 additions & 0 deletions helpers/FormatTime.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
require 'vendor/autoload.php';
use Carbon/Carbon;

/**
* @see https://github.com/josiahking/evolvephp for read me and documentation
* @copyright https://github.com/josiahking/evolvephp/blob/master/COPYRIGHT.md
* @license https://github.com/josiahking/evolvephp/blob/master/LICENSE.md
* @package EvolvePHP
* @author
* @link Documentation on this file
* @since Version 1.0
* @filesource
*/

namespace EvolvePhpHelper;

/**
*This class get the time a user visit a webpage and set an expiry time for when the session ends
*/

class FormatTime
{
/* This set the current time */
public function setTime()
{
$current = Carbon::now();
return $current;
}

/* Set an expiry time for 24 hours */
public function SetExpiry(){

$expires = formatDate()->addHours(24);

return $expires;
}