Navigation
Synopsis Print an input datetime using the given format string.
Function
  1. str printDateTime(datetime inputDateTime, str formatString)
  2. str printDateTime(datetime inputDateTime)
Usage import DateTime;
Examples
rascal>import DateTime;
ok
rascal>N = now();
datetime: $2014-10-28T10:39:42.395+00:00$
rascal>printDateTime(N);
str: "2014-10-28 10:39:42.395+0000"
rascal>printDateTime(N, "yyyy-MM-dd\'T\'HH:mm:ss.SSSZZ");
str: "2014-10-28T10:39:42.395+0000"
rascal>printDateTime(N, "YYYY/MM/dd/HH/mm/ss");
str: "2014/10/28/10/39/42"
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.