χρόνος

The Chronos Code that Generates the Schedule of Squeak Chat Meetings in Selected Time Zones

| stream timeZones printPolicy chatNumber |
timeZones := 
	#(UTC 'Pacific/Auckland' 'Australia/Sydney' 'Asia/Tokyo' 'Asia/Hong_Kong' 'Asia/Calcutta' 
	'Europe/Moscow' 'Asia/Jerusalem' 'Europe/Amsterdam' 'Europe/London' 'America/Sao_Paulo'
	'America/Argentina/Buenos_Aires' 'America/New_York' 'America/Chicago' 'America/Denver'
	'America/Los_Angeles' 'Pacific/Honolulu')
		collect: [:each | Timezone at: each asSymbol].
printPolicy := ChronosPrintPolicy 
				applying: 
					#(useMonthAbbreviation 
					showDayOfWeekAbbreviation 
					useDayMonthYearOrder 
					dateSeparator: $ 
					timeOfDayPrefix: $  
					use12HourFormat 
					showTimeZoneVerbosely 
					timeZoneSeparator: $ 
					timeZoneElementSeparator: nil).
[stream := (ResourcePath fromString: 'SqueakChatSchedule.html') newWriteStream.
stream 
	nextPutAll: '<h1>Squeak Chat Schedule for 2006</h1>'; cr; 
	nextPutAll: '<h2>Meeting start times by timezone (meeting duration is 4 hours)</h2>'; cr.
chatNumber := 0.
(DateAndTime year: 2006 month: January day: 4 hour: 20 minute: 0 second: 0 timeZone: #Universal) 
	through: (YearMonthDay year: 2006 month: December day: 31)
	every: 100
	hoursDo: 
		[:universalTime | 
		chatNumber := chatNumber + 1.
		stream 
			nextPutAll: '<h3>Chat #'; print: chatNumber; nextPutAll: '</h3>'; cr;
			nextPutAll: '<blockquote>'.
		((timeZones collect: [:timeZone | universalTime >> timeZone])
			asSortedCollection: [:timeA :timeB | timeA offset >= timeB offset]) 
				do: [:localTime |
					stream cr. 
					localTime printOn: stream using: printPolicy. 
					stream cr; nextPutAll: '<br>'].
		stream cr; nextPutAll: '</blockquote>'; cr].
stream cr; nextPutAll: '<br>'] ensure: [stream close].

Here's the output: Squeak Chat Schedule for 2006

[Chronos] All code (classes and methods, and all associated documentation,) distributed as part of the Chronos Date/Time library are © Copyright 2005-2006 by Alan L. Lovejoy.  All Rights Reserved. Usage is controlled by the Chronos License (which is included in the distribution as the contents of the file {chronos-license.txt}, and is also available from the Chronos web site {http://www.chronos-st.org/License.html})

"Do not go gentle into that good night,
Old age should burn and rave at the close of the day;
Rage, rage at the dying of the light!" -- Dylan Thomas