### Date and Time Formats

To set the date and time format, use DateTime.DateFormat.
Example:
DateTime.DateFormat = "dd.MM.yyyy HH:mm"
Reference: http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
Reference: https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
Example
`Sub showDateTimeFormat(dtformat As String)
DateTime.DateFormat = dtformat
Log(dtformat & " = " & DateTime.Date(DateTime.Now))
End Sub`
`Sub buttonTest_Action
Log("*** Test Date Format *** ")
showDateTimeFormat("dd.MM.yyyy HH:mm")
showDateTimeFormat("dd.MM.yyyy")
showDateTimeFormat("yyyyMMdd")
showDateTimeFormat("MM/dd/yy")
showDateTimeFormat("dd/MM/yy")
showDateTimeFormat("dd-MMM-yy")
showDateTimeFormat("yyyy.MM.dd.HH.mm.ss")
showDateTimeFormat("E, dd MMM yyyy HH:mm:ss Z")
showDateTimeFormat("EEEE, dd MMMM yyyy HH:mm:ss zzzz")
showDateTimeFormat("w")
End Sub`
Result:
*** Test Date Format ***
dd.MM.yyyy HH:mm: 14.09.2014 11:20
dd.MM.yyyy: 14.09.2014
yyyyMMdd: 20140914
MM/dd/yy: 09/14/14
dd/MM/yy: 14/09/14
dd-MMM-yy: 14-Sep-14
yyyy.MM.dd.HH.mm.ss: 2014.09.14.11.20.43
E, dd MMM yyyy HH:mm:ss Z: So, 14 Sep 2014 11:20:43 +0200
EEEE, dd MMMM yyyy HH:mm:ss zzzz: Sonntag, 14 September 2014 11:20:43 Mitteleuropäische Sommerzeit
w: 37

Changed: , Category: DateTime, File: T6C183M1324.htm, ID: 1324