Monday, November 08, 2010 at 12:00 AM.

scripting2Suite.server.getLocalTime

on getLocalTime (username, theTime=clock.now ()) {
	<<Changes
		<<6/14/10; 7:36:16 AM by DW
			<<Suppose your server thinks it's in the Pacific time zone, but the author of the blog is in the Eastern time zone. You want to display the time in the zone of the author. We do the math to do the conversion.
	local (adrdata = scripting2suite.inituser (username));
	local (gmt = date (theTime) - date.getCurrentTimeZone ());
	local (usertimezone = adrdata^.prefs.timeZone * 3600);
	return (gmt + userTimeZone)};
bundle { //test code
	dialog.alert (getLocalTime ("davewiner"))}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.