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-02-14T09:30:23.451+01:00$
rascal>printDateTime(N);
str: "2014-02-14 09:30:23.451+0100"
rascal>printDateTime(N, "yyyy-MM-dd\'T\'HH:mm:ss.SSSZZ");
str: "2014-02-14T09:30:23.451+0100"
rascal>printDateTime(N, "YYYY/MM/dd/HH/mm/ss");
str: "2014/02/14/09/30/23"
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.