Adding strtotime()
This commit is contained in:
parent
d3917a1c24
commit
e5ca49d3e8
25
classes.php
25
classes.php
@ -203,6 +203,31 @@ class ActionDateC extends AbstractAction
|
||||
}
|
||||
}
|
||||
|
||||
class ActionStrtotime extends AbstractAction
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setContainer( new DivContainer );
|
||||
$this->setFormatter( new EchoFormatter );
|
||||
}
|
||||
|
||||
public function decode()
|
||||
{
|
||||
$tz = date_default_timezone_get();
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
$time = strtotime($this->value);
|
||||
$str_utc = date('c', $time);
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
$str_ny = date('c', $time);
|
||||
|
||||
date_default_timezone_set($tz);
|
||||
|
||||
return "$time<br>$str_utc<br>$str_ny";
|
||||
}
|
||||
}
|
||||
|
||||
class ActionAnsi2Html extends AbstractAction
|
||||
{
|
||||
public function setUp()
|
||||
|
@ -46,6 +46,7 @@ if( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
|
||||
<option value="JsonDecode" <?php echo selected($action_str, 'JsonDecode'); ?>>json_decode()</option>
|
||||
<option value="JsonEncode" <?php echo selected($action_str, 'JsonEncode'); ?>>json_encode()</option>
|
||||
<option value="DateC" <?php echo selected($action_str, 'DateC'); ?>>date('c', $timestamp)</option>
|
||||
<option value="Strtotime" <?php echo selected($action_str, 'Strtotime'); ?>>strtotime()</option>
|
||||
<option value="ParseStr" <?php echo selected($action_str, 'ParseStr'); ?>>parse_str()</option>
|
||||
<option value="Ansi2Html" <?php echo selected($action_str, 'Ansi2HTml'); ?>>ansi-to-html</option>
|
||||
<select>
|
||||
|
Loading…
Reference in New Issue
Block a user