--- loncom/interface/lonhelper.pm	2006/01/17 18:39:50	1.129
+++ loncom/interface/lonhelper.pm	2006/01/24 22:20:19	1.130
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.129 2006/01/17 18:39:50 albertel Exp $
+# $Id: lonhelper.pm,v 1.130 2006/01/24 22:20:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1561,6 +1561,8 @@ sub render {
     my $date;
 
     my $time=time;
+    $date = localtime($time);
+    $date->min(0);
     my ($anytime,$onclick);
 
     if (defined($self->{DEFAULT_VALUE})) {
@@ -1568,14 +1570,18 @@ sub render {
         die('Error in default value code for variable ' . 
             $self->{'variable'} . ', Perl said: ' . $@) if $@;
         $time = &$valueFunc($helper, $self);
-	if (lc($time) eq 'anytime') { $time=time; $anytime=1; }
+	if (lc($time) eq 'anytime') {
+	    $anytime=1;
+	} else {
+	    $date = localtime($time);
+	}
+    } else {
+
     }
     if ($anytime) {
 	$onclick = "onclick=\"javascript:updateCheck(this.form,'${var}anytime',false)\"";
     }
     # Default date: The current hour.
-    $date = localtime($time);
-    $date->min(0);
 
     if (defined $self->{ERROR_MSG}) {
         $result .= '<font color="#FF0000">' . $self->{ERROR_MSG} . '</font><br /><br />';