Tag Info

New answers tagged

-1

$TimeZone is particular to your version of Mathematica, may change, and is not in some versoions of Mathematica. Do not rely on notebook with $TimeZone hacks working for other Mathematica users. It's intended to be your time zone for your site for your convenience for "city time" not for sea time, and is not to be a variable time zone used in calculations. ...


2

There is just one pair of {} missing DateListPlot[Transpose@{dates, values}, Joined -> True, FrameTicks -> {{{#, #, {0, 0.05}} & /@ Range[-30, 30, 2], None}, {{{#}, #, {0, 0.05}} & /@ Range[2002, 2012, 1], None}}] By adding the extra {} a shortened date list is created, which is one of the possible date forms needed for the ...


0

Well... d~d[[0]]~t ...seems to work.


12

Another, shorter way is Append[d, t] From the docs, DateObject[date,time] represents the specified date list and TimeObject time. If you need the list you mention in the question, just convert the DateObject using DateList: DateList@Append[d, t] (* {2012, 6, 11, 14, 1, 45.} *)


3

Strip off their heads. replace them with List and then Flatten them: dt=DateObject@@(List @@@ {d, t} // Flatten) DateObject[{2012, 6, 11, 14, 1, 45.}] Or .... dt=DateObject @@ Join @@ {d[[1]], t[[1]]}


0

synthetic data: strings = DateString /@ Sort@RandomVariate[ NormalDistribution[AbsoluteTime[Date[]], 10^7],200]; Note this date string format is not exactly the same as yours but I think all this will still work. DateListPlot[MapIndexed[ {#, First@#2} &, strings ], Ticks -> {DateRange[{2013, 12}, {2016, 2}, {{3, "Month"}}], ...



Top 50 recent answers are included