Strings
[ class tree: Strings ] [ index: Strings ] [ all elements ]

Class: STRtimes

Source Location: /STRtimes.php

Class Overview

Strings
   |
   --STRtimes

This class manages time objects.


Author(s):

Version:

  • 2.2

Variables

Methods


Inherited Variables

Inherited Methods

Class: Strings

Strings::__construct()
Construction function
Strings::console()
Console function
Strings::IsUTF8()
UTF8 detection function
Strings::QuoteStrip()
Quotes stripping function
Strings::RemoveAccent()
Accents removal function
Strings::RemoveSpaces()
Spaces removal function
Strings::stringHasNumbers()
Numbers detection function
Strings::ToUTF8()
UTF8 conversion function
Strings::ucwordsw()
Special uppercase function

Class Details

[line 35]
This class manages time objects.

Created on 17 apr 09

Changes: 2.1 -> 2.2: 27 jul 09 updated: class has been renamed from Arrays() to CMNarrays() 2.0 -> 2.1: 21 jul 09 added: file is PEAR compatible added: to package Common 1.0 -> 2.0: updated: phpdoc compatible in the way to generate documentation




Tags:

author:  Pierre-Dominique Vienne <pvienne@me.com>
version:  2.2
license:  GNU Public License


[ Top ]


Class Variables

$new_separator =  ":"

[line 41]

Variable that defines time separator



Tags:

access:  public

Type:   string


[ Top ]

$time_regex =  
'/^((?:0?[0-9])|(?:[01][0-9])|(?:2[0-4]))\D?([0-5][0-9])(?:\D?([0-5][0-9]))?$/si'

[line 48]

Variable that defines regular expression used to extract hours,

minutes, seconds




Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


method checkTime [line 94]

bool checkTime( [bool $passed = false], string $this->value)

H:mm:ss time validation function

This function is used to valid a H:mm:ss time Result is returned

  1.  <?php
  2.  $oTimes        new STRtimes();
  3.  $oTimes->value "23:43:12";
  4.  echo $oTimes->checkTime();
  5.  // 1
  6.  ?>




Tags:

return:  true if date is valid
since:  version 1.0


Parameters:

string   $this->value   time string to be processed (required)
bool   $passed   if set to true, the time must be in the past

[ Top ]

method formatTime [line 224]

object this formatTime( [string $new_separator = null])

Time formatter function

This function is used to format times Result is stored in $this->value and object is returned

  1.  <?php
  2.  $oTimes        new STRtimes();
  3.  $oTimes->value "213412";
  4.  echo $oTimes->formatTime(":")->value;
  5.  // 21:34:12
  6.  ?>




Tags:

return:  object
since:  version 1.0
usedby:  STRlines::formatLine()
uses:  STRtimes::timeSeparatorSetter()


Parameters:

string   $new_separator   separator that will be used to format the time

[ Top ]

method listHours [line 151]

array listHours( )

Hours listing function

This function is used to list hours of a day Result is returned

  1.  <?php
  2.  $oTimes            new STRtimes();
  3.  echo implode(" "$oTimes->listHours());
  4.  // 1 2 3 4 5 6 7 8 9 10 11 12... 23
  5.  ?>




Tags:

return:  hours listing
since:  version 1.0
usedby:  STRdates::ListAll()
usedby:  STRdates::ListHours()


[ Top ]

method listMinutes [line 185]

array listMinutes( )

Minutes listing function

This function is used to list minutes of an hour Result is returned

  1.  <?php
  2.  $oTimes            new STRtimes();
  3.  echo implode(" "$oTimes->listMinutes());
  4.  // 01 02 03 04 05 06 07 08 09 10 11 12... 59
  5.  ?>




Tags:

return:  minutes listing
since:  version 1.0
usedby:  STRdates::ListAll()
usedby:  STRdates::ListMinutes()


[ Top ]

method timeSeparatorSetter [line 266]

object this timeSeparatorSetter( string $new_separator)

Time separator setter function

This function is used to set time separator function Result is stored in $this->new_separator and object is returned

  1.  <?php
  2.  $oTimes            new STRtimes();
  3.  $oTimes->timeSeparatorSetter(":");
  4.  ?>




Tags:

return:  object
since:  version 1.0
usedby:  STRtimes::formatTime()


Parameters:

string   $new_separator   separator that will be used to format the time

[ Top ]


Documentation generated on Wed, 26 Aug 2009 12:30:49 +0200 by phpDocumentor 1.4.1