[squeak-dev] The Inbox: Network-tonyg.119.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Sep 12 13:30:03 UTC 2011
A new version of Network was added to project The Inbox:
http://source.squeak.org/inbox/Network-tonyg.119.mcz
==================== Summary ====================
Name: Network-tonyg.119
Author: tonyg
Time: 12 September 2011, 9:29:51.82 am
UUID: d7bcc3f8-9f5e-4e65-afa7-36b6e9126df7
Ancestors: Network-ul.118
Avoid printing fractional seconds into an email "Date:" header, since the RFC forbids non-integer seconds in dates.
=============== Diff against Network-ul.118 ===============
Item was added:
+ ----- Method: MailMessage class>>dateStamp: (in category 'utilities') -----
+ dateStamp: aDateAndTime
+ "Return the given date and time formatted as a email Date: line"
+ "The result conforms to RFC822 with a long year, e.g. 'Thu, 18 Feb 1999 20:38:51'"
+ | d t |
+ d := aDateAndTime asDate.
+ t := aDateAndTime asTime.
+ ^ (d weekday copyFrom: 1 to: 3), ', ',
+ (d printFormat: #(1 2 3 $ 2 1 1)), ' ',
+ "We are careful to avoid fractional seconds appearing in the result:"
+ (Time fromSeconds: t asSeconds) print24!
Item was changed:
----- Method: MailMessage class>>dateStampNow (in category 'utilities') -----
dateStampNow
"Return the current date and time formatted as a email Date: line"
+ ^ self dateStamp: DateAndTime now!
- "The result conforms to RFC822 with a long year, e.g. 'Thu, 18 Feb 1999 20:38:51'"
-
- ^ (Date today weekday copyFrom: 1 to: 3), ', ',
- (Date today printFormat: #(1 2 3 $ 2 1 1)), ' ',
- Time now print24!
More information about the Squeak-dev
mailing list
|