[Rt-commit] r18862 - rt/3.999/branches/datetime/lib/RT

sartak at bestpractical.com sartak at bestpractical.com
Thu Mar 19 16:15:55 EDT 2009


Author: sartak
Date: Thu Mar 19 16:15:55 2009
New Revision: 18862

Modified:
   rt/3.999/branches/datetime/lib/RT/DateTime.pm

Log:
RT::DateTime->rfc2616

Modified: rt/3.999/branches/datetime/lib/RT/DateTime.pm
==============================================================================
--- rt/3.999/branches/datetime/lib/RT/DateTime.pm	(original)
+++ rt/3.999/branches/datetime/lib/RT/DateTime.pm	Thu Mar 19 16:15:55 2009
@@ -106,6 +106,16 @@
     return $self->strftime('%a, %d %b %Y %H:%M:%S %z');
 }
 
+sub rfc2616 {
+    my $self = _canonicalize_self(@_);
+
+    # Always in UTC!
+    my $in_utc = $self->clone;
+    $in_utc->set_time_zone('UTC');
+
+    return $in_utc->strftime('%a, %d %b %Y %H:%M:%S GMT');
+}
+
 sub iso {
     my $self = _canonicalize_self(@_);
 


More information about the Rt-commit mailing list