Skip to content

Commit a06fdf3

Browse files
committed
Merge pull request #61 from dovg/date-sugar
add toFormatString() method
2 parents c08140b + a4e4fff commit a06fdf3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

core/Base/Date.class.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,11 @@ public function toString()
274274
return $this->string;
275275
}
276276

277+
public function toFormatString($format)
278+
{
279+
return date($format, $this->toStamp());
280+
}
281+
277282
public function toDialectString(Dialect $dialect)
278283
{
279284
// there are no known differences yet

doc/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2012-01-13 Alexander A. Zaytsev
2+
3+
* core/Base/Date.class.php: toFormatString method added.
4+
15
2012-01-11 Evgeny V. Kokovikhin
26

37
* core/DB/Dialect.class.php: throw exception for null values. Thanks to

0 commit comments

Comments
 (0)