How do you display the current date and time in Crystal Reports?
Create a new formula and use:
CurrentDateTime
This would display the following:
18.05.2015 2:28:46PM
Then you can format it using ToText:
ToText(CurrentDateTime, "dd/MM/yyyy HH:mm:ss")
Which would display (same as first example's datetime) :
18/05/2015 14:28:46
-
1Thanks @goamn, it works for me. You should mark this one as an answer. – Tuyen Nguyen Aug 26 '15 at 21:06
Just to add:
ToText(currentdatetime,"dd/M/yy hh:mm") will display as 8/2/17 04:26
where as
ToText(currentdatetime,"d/M/yy HH:mm") will display as 8/2/17 16:26
(For those who would like to change the time to a 24 hour format)
CurrentDateTime
will return dd.MM.yyyy hh:mm:ss
if you want to display the date without any Delimiter and not in datetime, then TONUMBER(ToText(CurrentDateTime,"yyMMdd"))
will return yyMMdd
[datetime][crystalreport]