Bloodholds
New Member
Hi,
Is there a problem with the DateTime function, or am I just missing something?
Here is a block of sample code:
Dim DateString as String = "20140219T002304"
Dim DateTicks as Long
DateTime.DateFormat = "yyyyMMDD'T'HHmmss" 'EDIT <-Error here, "DD" should be "dd"
DateTicks = DateTime.DateParse(DateString)
DateTime.DateFormat = "dd/MM/yyyy HH:mm:ss"
log(DateTime.Date(DateTicks))
The result is: 19/01/2014 00:23:04
If DateString = "20131022T205542", the result would be 22/01/2013 20:55:42
This is mostly correct, except that the month is always January (no matter what value you assign to DateString).
Is there a problem with the DateTime function, or am I just missing something?
Here is a block of sample code:
Dim DateString as String = "20140219T002304"
Dim DateTicks as Long
DateTime.DateFormat = "yyyyMMDD'T'HHmmss" 'EDIT <-Error here, "DD" should be "dd"
DateTicks = DateTime.DateParse(DateString)
DateTime.DateFormat = "dd/MM/yyyy HH:mm:ss"
log(DateTime.Date(DateTicks))
The result is: 19/01/2014 00:23:04
If DateString = "20131022T205542", the result would be 22/01/2013 20:55:42
This is mostly correct, except that the month is always January (no matter what value you assign to DateString).
Last edited: