Index: trunk/psLib/src/astro/psTime.c
===================================================================
--- trunk/psLib/src/astro/psTime.c	(revision 22708)
+++ trunk/psLib/src/astro/psTime.c	(revision 22710)
@@ -61,4 +61,5 @@
 static char *timeConfig = NULL;         // Time config file path
 static psMetadata *timeMetadata = NULL; // Time metadata read from config file
+static int isoDecimals = 6;             // Number of decimals to use in a string by psTimeToISO
 
 
@@ -1353,7 +1354,20 @@
 }
 
+
+int psTimeSetISODecimals(int num)
+{
+    int temp = isoDecimals;          // Current value, to return
+    isoDecimals = num;
+    return temp;
+}
+
+int psTimeGetISODecimals(void)
+{
+    return isoDecimals;
+}
+
 psString psTimeToISO(const psTime *time)
 {
-    return timeToString(time, 9);       // Use all 9 decimals allowed by the nanoseconds
+    return timeToString(time, isoDecimals);
 }
 
Index: trunk/psLib/src/astro/psTime.h
===================================================================
--- trunk/psLib/src/astro/psTime.h	(revision 22708)
+++ trunk/psLib/src/astro/psTime.h	(revision 22710)
@@ -241,5 +241,5 @@
 /** Convert psTime to ISO8601 formatted string.
  *
- *  Converts psTime to a null terminated string in the form of YYYY-MM-DDThh:mm:ss.sssssssss.
+ *  Converts psTime to a null terminated string in the form of YYYY-MM-DDThh:mm:ss.ssssss
  *  This function does not add or subtract leapseconds.
  *
@@ -249,4 +249,18 @@
     const psTime* time                  ///< Input time to be converted.
 );
+
+/** Set number of decimals printed by psTimeToISO
+ *
+ * @return int: Previous setting
+ */
+int psTimeSetISODecimals(
+    int num                             ///< Number of decimals to print
+    );
+
+/** Get number of decimals printed by psTimeToISO
+ *
+ * @return int: Current setting
+ */
+int psTimeGetISODecimals(void);
 
 /** Convert psTime to ISO8601 formatted string with limited decimal places
