String sutil.convertDateToString ( Date date ) (professional and enterprise editions only)
String sutil.convertDateToString ( Date date, String format ) (professional and enterprise editions only)


Converts the Date given to a string in a specified format, or in the "MM/dd/yyyy HH:mm:ss.SS zzz" if no format is given.


  • date The date to convert
  • format (optional) A String representation (as a SimpleDateFormat) for the output

Return Values

A String representing the date given

Change Log

Version Description
5.5.26a Available in all editions.


// Log the current time
Date now = new Date();
session.log(sutil.convertDateToString(now, "MM/dd/yyyy HH:mm:ss zzz"));