projects
/
koha.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c260e5
)
Bug 5549 : Let Timestamp do the right thing if passed a DateTime
author
Colin Campbell
<colin.campbell@ptfs-europe.com>
Tue, 21 Jun 2011 10:08:20 +0000
(11:08 +0100)
committer
Chris Cormack
<chrisc@catalyst.net.nz>
Tue, 20 Mar 2012 00:20:54 +0000
(13:20 +1300)
C4/SIP/Sip.pm
patch
|
blob
|
history
diff --git
a/C4/SIP/Sip.pm
b/C4/SIP/Sip.pm
index
337cc0e
..
4e3f299
100644
(file)
--- a/
C4/SIP/Sip.pm
+++ b/
C4/SIP/Sip.pm
@@
-50,7
+50,9
@@
our $last_response = '';
sub timestamp {
my $time = $_[0] || time();
- if ($time=~m/^(\d{4})\-(\d{2})\-(\d{2})/) {
+ if ( ref $time eq 'DateTime') {
+ return $time->strftime(SIP_DATETIME);
+ } elsif ($time=~m/^(\d{4})\-(\d{2})\-(\d{2})/) {
# passing a db returned date as is + bogus time
return sprintf( '%04d%02d%02d 235900', $1, $2, $3);
}