summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Duedal <hd@onlinecity.dk>2011-10-05 09:49:40 +0200
committerHans Duedal <hd@onlinecity.dk>2011-10-05 09:49:40 +0200
commit01bc959c53c3f1484c3eff2d147e2b3ace7a9b1a (patch)
tree1adeca487f227cfee4e0c4c177cc650b19438004
parentd4620c74778ccf1765c1bd352aab3f6ab41bdea0 (diff)
parent2f41801e80b664d59849f4cc77f593e167bf8ef5 (diff)
downloadphp-smpp-01bc959c53c3f1484c3eff2d147e2b3ace7a9b1a.zip
php-smpp-01bc959c53c3f1484c3eff2d147e2b3ace7a9b1a.tar.gz
php-smpp-01bc959c53c3f1484c3eff2d147e2b3ace7a9b1a.tar.bz2
Merge branch 'develop' of github.com:onlinecity/php-smpp into develop
-rw-r--r--smppclient.class.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/smppclient.class.php b/smppclient.class.php
index 52982aa..0dcbb7d 100644
--- a/smppclient.class.php
+++ b/smppclient.class.php
@@ -141,11 +141,12 @@ class SmppClient
/**
* Parse a timestring as formatted by SMPP v3.4 section 7.1.
- * Returns an unix timestamp if $newDates is false or DateTime/DateInterval is missing
+ * Returns an unix timestamp if $newDates is false or DateTime/DateInterval is missing,
+ * otherwise an object of either DateTime or DateInterval is returned.
*
* @param string $input
* @param boolean $newDates
- * @return int
+ * @return mixed
*/
public function parseSmppTime($input, $newDates=true)
{
@@ -174,7 +175,7 @@ class SmppClient
} else {
$offsetHours = floor($n/4);
$offsetMinutes = ($n % 4)*15;
- $time = sprintf("20%02s-%02s-%02sT%02s:%02s:%02s+%02s:%02s",$y,$m,$d,$h,$i,$s,$offsetHours,$offsetMinutes); // Not Y3K safe
+ $time = sprintf("20%02s-%02s-%02sT%02s:%02s:%02s%s%02s:%02s",$y,$m,$d,$h,$i,$s,$p,$offsetHours,$offsetMinutes); // Not Y3K safe
if ($newDates) {
return new DateTime($time);
} else {
@@ -1228,4 +1229,4 @@ class SmppTag
{
return pack('nn'.$this->type, $this->id, ($this->length ? $this->length : strlen($this->value)), $this->value);
}
-} \ No newline at end of file
+}