Skip to main content
added 198 characters in body
Source Link
rcollyer
  • 34.3k
  • 7
  • 95
  • 198

Using DateList first and then using DateObject seems to work:

DateObject[ DateList[{"2014/01/09 07:24:36:985", {"Year", "/", "Month", "/", "Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] 

The fractional seconds are in the DateObject, but are not displayed.

Consider:

date1 = DateObject[DateList[{"2014/01/09 07:24:36:555", {"Year", "/", "Month", "/","Day", " ", "Hour24", ":", "Minute", ":", "Second", ":","Millisecond"}}]] date2 = DateObject[DateList[{"2014/01/09 07:24:36:100", {"Year", "/", "Month", "/","Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] FullForm[date1] FullForm[date1 - date2] 

This is directly visible by looking at the InputForm, e.g.

InputForm@date1 (* DateObject[{2014, 1, 9}, TimeObject[{7, 24, 36.555}, TimeZone -> -6.], TimeZone -> -6.] *) 

Using DateList first and then using DateObject seems to work:

DateObject[ DateList[{"2014/01/09 07:24:36:985", {"Year", "/", "Month", "/", "Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] 

The fractional seconds are in the DateObject, but are not displayed.

Consider:

date1 = DateObject[DateList[{"2014/01/09 07:24:36:555", {"Year", "/", "Month", "/","Day", " ", "Hour24", ":", "Minute", ":", "Second", ":","Millisecond"}}]] date2 = DateObject[DateList[{"2014/01/09 07:24:36:100", {"Year", "/", "Month", "/","Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] FullForm[date1] FullForm[date1 - date2] 

Using DateList first and then using DateObject seems to work:

DateObject[ DateList[{"2014/01/09 07:24:36:985", {"Year", "/", "Month", "/", "Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] 

The fractional seconds are in the DateObject, but are not displayed.

Consider:

date1 = DateObject[DateList[{"2014/01/09 07:24:36:555", {"Year", "/", "Month", "/","Day", " ", "Hour24", ":", "Minute", ":", "Second", ":","Millisecond"}}]] date2 = DateObject[DateList[{"2014/01/09 07:24:36:100", {"Year", "/", "Month", "/","Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] FullForm[date1] FullForm[date1 - date2] 

This is directly visible by looking at the InputForm, e.g.

InputForm@date1 (* DateObject[{2014, 1, 9}, TimeObject[{7, 24, 36.555}, TimeZone -> -6.], TimeZone -> -6.] *) 
added 373 characters in body
Source Link
Rudy
  • 125
  • 7

Using DateList first and then using DateObject seems to work:

DateObject[ DateList[{"2014/01/09 07:24:36:985", {"Year", "/", "Month", "/", "Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] 

But still noThe fractional seconds. As previous comment suggests I guess it's are in the DateObject, but are not supporteddisplayed.

Consider:

date1 = DateObject[DateList[{"2014/01/09 07:24:36:555", {"Year", "/", "Month", "/","Day", " ", "Hour24", ":", "Minute", ":", "Second", ":","Millisecond"}}]] date2 = DateObject[DateList[{"2014/01/09 07:24:36:100", {"Year", "/", "Month", "/","Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] FullForm[date1] FullForm[date1 - date2] 

Using DateList first and then using DateObject seems to work:

DateObject[ DateList[{"2014/01/09 07:24:36:985", {"Year", "/", "Month", "/", "Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] 

But still no fractional seconds. As previous comment suggests I guess it's not supported.

Using DateList first and then using DateObject seems to work:

DateObject[ DateList[{"2014/01/09 07:24:36:985", {"Year", "/", "Month", "/", "Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] 

The fractional seconds are in the DateObject, but are not displayed.

Consider:

date1 = DateObject[DateList[{"2014/01/09 07:24:36:555", {"Year", "/", "Month", "/","Day", " ", "Hour24", ":", "Minute", ":", "Second", ":","Millisecond"}}]] date2 = DateObject[DateList[{"2014/01/09 07:24:36:100", {"Year", "/", "Month", "/","Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] FullForm[date1] FullForm[date1 - date2] 
Formatted code
Source Link
MarcoB
  • 68k
  • 19
  • 98
  • 205

Using DateListDateList first and then using DateObjectDateObject seems to work:

DateObject[ DateList[{"2014/01/09 07:24:36:985", {"Year", "/", "Month", "/", "Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]]

DateObject[ DateList[{"2014/01/09 07:24:36:985", {"Year", "/", "Month", "/", "Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] 

But still no fractional seconds. As previous comment suggests I guess it's not supported.

Using DateList first and then using DateObject seems to work:

DateObject[ DateList[{"2014/01/09 07:24:36:985", {"Year", "/", "Month", "/", "Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]]

But still no fractional seconds. As previous comment suggests I guess it's not supported.

Using DateList first and then using DateObject seems to work:

DateObject[ DateList[{"2014/01/09 07:24:36:985", {"Year", "/", "Month", "/", "Day", " ", "Hour24", ":", "Minute", ":", "Second", ":", "Millisecond"}}]] 

But still no fractional seconds. As previous comment suggests I guess it's not supported.

Source Link
Rudy
  • 125
  • 7
Loading