Changeset 6093
- Timestamp:
- 01/30/07 18:15:58 (2 years ago)
- Files:
-
- plugins/tzinfo_timezone/lib/tzinfo_timezone.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/tzinfo_timezone/lib/tzinfo_timezone.rb
r5198 r6093 162 162 # result. 163 163 def formatted_offset(colon=true) 164 return "" if utc_offset == 0 164 utc_offset == 0 ? '' : offset(colon) 165 end 166 167 # Returns the offset of this time zone as a formatted string, of the 168 # format "+HH:MM". 169 def offset(colon=true) 165 170 sign = (utc_offset < 0 ? -1 : 1) 166 171 hours = utc_offset.abs / 3600 … … 168 173 "%+03d%s%02d" % [ hours * sign, colon ? ":" : "", minutes ] 169 174 end 170 175 171 176 # Compute and return the current time, in the time zone represented by 172 177 # +self+.