todayDate() { var now = new DateTime.now(); var formatter = new DateFormat('dd-MM-yyyy'); String formattedTime = DateFormat('kk:mm:a').format(now); String formattedDate = formatter.format(now); print(formattedTime); print(formattedDate); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter