Index: geovis/trunk/Renderer.cpp
===================================================================
--- geovis/trunk/Renderer.cpp	(revision 4957)
+++ geovis/trunk/Renderer.cpp	(revision 4973)
@@ -736,8 +736,8 @@
         skyOpts.atmosphericLighting() = true;
         skyOpts.exposure() = 3.0;
-        osgEarth::Util::SkyNode *sky = osgEarth::Util::SkyNode::create(skyOpts, mapNode);
-        sky->addChild(mapNode);
-        sky->attach(_viewer.get(), 0);
-        _sceneRoot = sky;
+        _skyNode = osgEarth::Util::SkyNode::create(skyOpts, mapNode);
+        _skyNode->addChild(mapNode);
+        _skyNode->attach(_viewer.get(), 0);
+        _sceneRoot = _skyNode;
 #else
         _sceneRoot = new osg::Group();
@@ -745,9 +745,9 @@
 
         TRACE("Creating SkyNode");
-        osgEarth::Util::SkyNode *sky = new osgEarth::Util::SkyNode(map);
-        _sceneRoot->addChild(sky);
-        sky->setAmbientBrightness(0.2f);
-        sky->setDateTime(now);
-        sky->attach(_viewer.get(), 0);
+        _skyNode = new osgEarth::Util::SkyNode(map);
+        _sceneRoot->addChild(_skyNode.get());
+        _skyNode->setAmbientBrightness(0.2f);
+        _skyNode->setDateTime(now);
+        _skyNode->attach(_viewer.get(), 0);
 #endif
     } else {
@@ -811,4 +811,13 @@
         }
         _verticalScale->setScale(scale);
+        _needsRedraw = true;
+    }
+}
+
+void Renderer::setEphemerisTime(int year, int month, int day, double hours)
+{
+    if (_skyNode.valid()) {
+        osgEarth::DateTime time(year, month, day, hours);
+        _skyNode->setDateTime(time);
         _needsRedraw = true;
     }
Index: geovis/trunk/Renderer.h
===================================================================
--- geovis/trunk/Renderer.h	(revision 4957)
+++ geovis/trunk/Renderer.h	(revision 4973)
@@ -22,4 +22,5 @@
 #include <osgUtil/IncrementalCompileOperation>
 
+#include <osgEarth/Version>
 #include <osgEarth/StringUtils>
 #include <osgEarth/Map>
@@ -33,4 +34,9 @@
 #include <osgEarthAnnotation/AnnotationNode>
 #include <osgEarthAnnotation/FeatureNode>
+#if OSGEARTH_MIN_VERSION_REQUIRED(2, 5, 1)
+#include <osgEarthUtil/Sky>
+#else
+#include <osgEarthUtil/SkyNode>
+#endif
 #include <osgEarthUtil/EarthManipulator>
 #include <osgEarthUtil/MouseCoordsTool>
@@ -195,4 +201,6 @@
     void setTerrainWireframe(bool state);
 
+    void setEphemerisTime(int year, int month, int day, double hours);
+
     // Image raster layers
 
@@ -517,4 +525,5 @@
     osg::ref_ptr<osgEarth::MapNode> _mapNode;
     osg::ref_ptr<osgEarth::Map> _map;
+    osg::ref_ptr<osgEarth::Util::SkyNode> _skyNode;
     osg::ref_ptr<osgViewer::Viewer> _viewer;
     osg::ref_ptr<ScreenCaptureCallback> _captureCallback;
Index: geovis/trunk/RendererCmd.cpp
===================================================================
--- geovis/trunk/RendererCmd.cpp	(revision 4957)
+++ geovis/trunk/RendererCmd.cpp	(revision 4973)
@@ -1727,4 +1727,40 @@
 }
 
+static int
+MapTimeOp(ClientData clientData, Tcl_Interp *interp, int objc, 
+          Tcl_Obj *const *objv)
+{
+    osgEarth::DateTime now;
+    int year, month, day;
+    double hours;
+    year = now.year();
+    month = now.month();
+    day = now.day();
+    hours = now.hours();
+    if (objc > 2) {
+        if (Tcl_GetDoubleFromObj(interp, objv[2], &hours) != TCL_OK) {
+            return TCL_ERROR;
+        }
+    }
+    if (objc > 3) {
+        if (Tcl_GetIntFromObj(interp, objv[3], &day) != TCL_OK) {
+            return TCL_ERROR;
+        }
+    }
+    if (objc > 4) {
+        if (Tcl_GetIntFromObj(interp, objv[4], &month) != TCL_OK) {
+            return TCL_ERROR;
+        }
+    }
+    if (objc > 5) {
+        if (Tcl_GetIntFromObj(interp, objv[5], &year) != TCL_OK) {
+            return TCL_ERROR;
+        }
+    }
+
+    g_renderer->setEphemerisTime(year, month, day, hours);
+    return TCL_OK;
+}
+
 static CmdSpec mapOps[] = {
     {"box",      1, MapBoxOp,             3, 0, "op ?params..."},
@@ -1739,4 +1775,5 @@
     {"setpos",   1, MapSetPositionOp,     2, 4, "x y"},
     {"terrain",  1, MapTerrainOp,         3, 0, "op ?params...?"},
+    {"time",     1, MapTimeOp,            2, 6, "?hours? ?day? ?month? ?year?"},
 };
 static int nMapOps = NumCmdSpecs(mapOps);
Index: geovis/trunk/geovis_protocol.txt
===================================================================
--- geovis/trunk/geovis_protocol.txt	(revision 4957)
+++ geovis/trunk/geovis_protocol.txt	(revision 4973)
@@ -206,4 +206,7 @@
     Set scale factor for terrain height
 map terrain wireframe <bool>
+map time <?hours?> <?day?> <?month?> <?year?>
+    Set ephemeris time for sky.  When args are omitted, set to current time.
+    Time is interpreted as server's local time.
 
 ================================================================================
