Tagged Questions

Questions about Mathematica's date and time functions.

2k views

How can I manipulate TemporalData?

Version 9 introduced TemporalData but, truth be told, the documentation doesn't suggest that one can do much with it. Many of us have probably assumed we'd be ...
1k views

Does Mathematica have a built-in date picker?

Does Mathematica have an interactive date input control that lets the user choose a date by browsing to a calendar view and returning the selected date as a date list? For example, something like the ...
3k views

The Orbit and Perigee of the Flamsteed comet

Historical context This year we have the 330-th anniversary of the Battle of Vienna - one of the great formative events of European history, it took place on September 12, 1683. Kara Mustafa, Grand ...
794 views

What calendar is Mathematica using for dates in the distant past?

It appears that Mathematica treats all dates as proleptic Gregorian dates by default, a hypothesis that can be easily tested by using AbsoluteTime to compute the ...
1k views

Faster alternatives for DayOfWeek

It has been noticed on several occasions that DayOfWeek function is rather slow when applied to a large list of dates, e.g. in this recent question. What faster ...
5k views

how to make graphic timelines in mathematica

Hi does anyone know how to make timelines with mathematica? Something like that would be great!
2k views

How can I make a heatmap of a days in year?

I know Mathematica has a ListPlot for time series but does it have a function for visualizing a list of dates as a heat map like this: This idea is from D3, check it out here.
2k views

Determining the week of a year from a given date

Consider the following: AbsoluteTime["17/04/2012",{"Day","/","Month","Year"}]; From my calendar in my office, I know that April 17th is in the 16th week of the ...
310 views

Is there a way to get AbsoluteTime to correctly report absolute time differences?

Absolute time supposedly reports the "total number of seconds" between two dates, but it does not. For example because of the leap second applied at 2012-06-30T23:59:60Z ...
286 views

Min, Max are slow on TimeObjects

fixed in 10.1 (windows) There's something wrong with how Min and Max are implemented for ...
2k views

How do I compute sidereal time and JD?

There was once a package that provided a wide range of functions for computing astronomical information. This package now appears to be out of date; but as near as I can tell, many of the useful ...
503 views

Does Mathematica support importing ISO 8601 date strings?

Does Mathematica have a built-in function to convert ISO 8601 formatted date strings (e.g. 2012-01-04T00:00:00) to a date list? ISO 8601 strings come in a variety ...
370 views

How to evaluate the second argument of Cases only once

I'd like to find a fast but readable way to achieve the following: ...
3k views

Measuring execution time of code

How one can measure the execution time (time that is spent for code to finish) of a program in Mathematica? I understand that there are general timing functions (Timing, AbsoluteTiming, TimeUsed, etc....
382 views

ScheduledTask with scoped variables. Working with timed evaluation

I guess I have to try harder and focus more but timed evaluation always frustrates me. I will show the issue on simple example of delayed trigger. ...
406 views

How is AstronomicalData interpreting its date arguments?

It is easy to confirm that the AstronomicalData is not interpreting its arguments as UTC (or "GMT", which is, in any case, ambiguous) dates by verifying that the ...
2k views

Sort date list in format DD/MM/YYYY

I have a list of dates (ranging from 2007 to 2012) in the DD/MM/YYYY format and I need to sort this list. My problem is, when I simply use Sort[] I get: ...
915 views

Simpler way to fill date gaps with zero values

One basic problem when working with data like sales and dates is the case where you dont't have sales in all days, so you have to fill it to take information as average or to make a plot. See this toy ...
256 views

DateList coupled with String Operations

Through some webscraping, I have the following list: ...
280 views

TimeConstrained dynamic change of maximum time

I would like to run a time consuming function: TimeConstrained[f[x],maxseconds] and be able to change maxseconds during running (increasing or decreasing max ...
1k views

Is it possible to import dates and times directly as AbsoluteTime and by pass DateLists?

Date and time calculations are quite slow so I am exploring ways to minimize the number of calculations performed. As an example: ...
184 views

DateDifference isn't consistent when giving result in years

This isn't really causing me a problem at the moment, but it's weird. Is this documented anywhere? When I ask for the difference in days and then in years between April 1, 2015 and October 1, 2015 ...
299 views

Approaches For Creating Cycle Plots in Mathematica

I am trying to create a cycle plot in Mathematica, and I am having a hard time finding the right approach to create the visualization. Can anyone give me a few pointers as to how to approach the ...
838 views

MovingAverage[] and Fit[] with data containing DateLists

I have data which has the following appearance: data = {{DateList, Real}, ..., {DateList, Real}} It's easy to visualize the data by using ...
1k views

UNIX time to DateList

I have data that is timestamped with UNIX time, which is the number of seconds since January 1, 1970 UTC. Unfortunately, it seems that most of the date and time functions in Mathematica are based on ...
696 views

How to import date (YYYY-MM-DD) data from a file?

I have a file with data in form {date, value}: 2010-05-19 17 2010-05-20 20 ...
521 views

How can I get the frame ticks from DateListPlot?

DateListPlot very nicely chooses major and minor frame tick and frame tick label/markers. I am building a custom graphics function where either the ...
250 views

Behavior of TimelinePlot with multiple datasets of associations

Bug introduced in 10.1 and fixed in 10.3 The following TimelinePlot behaves as I would expect: ...
117 views

DateList not using current year when a year is not specified

According to the documentation when using DateList but not giving it a year it should use the current year. It is not doing that for me. Instead it uses 1900. ...
222 views

Why do DateList, DateString, and AstronomicalData ignore \$TimeZone?

My reading of the documentation for DateList and DateString lead me to believe that both functions use ...
496 views

Does Mathematica have Month Range and Day range?

It is known that CharacterRange["a", "z"] gives list of characters from a to z. Does Mathematica have something similar for weekdays and months of the year? ...
507 views

Calendar view outline

How to compute the outline of a calendar month like this D3 example. (D3 is a functional language built on JavaScript developed at Stanford and used by New York Times to deploy interactive graphics.)...
403 views

Faster Alternatives to DateDifference

I need a faster implementation of FractionOfYear and FractionOfMonth, which do the following: Input: A time/date specified by <...
397 views

interpolating function over dates

I've got a bunch of readings at various dates and times. I'd like to be able to interpolate and then integrate over, say days. I can do this by converting my date/time to ...
275 views

How can I convert the dates returned by FinancialData into decimal representation?

I'm trying to run a regression using Fit on the output of FinancialData["SPY", "Jan. 1, 2011"]. However, the dates returned ...
289 views

How do I determine astronomical transit times?

Mathematica, through the "legacy" Scientific Astronomer package, used to have the ability to easily determine accurate transit times of astronomical objects simply, with ...
429 views

How much time should one give Mathematica for an integral evaluation?

Sometimes when I do integrals in Mathematica (M), it keeps thinking and thinking and I have no idea what is going on inside M. For how long should one wait or how does one know whether M has not got ...
234 views

How to do DateDifference on table items containing dates

I have a Table with data in form {{date}, value}: ...
378 views

Timeline plotting: horizontal bars of time intervals

This text file logs the time that a process (identified by a number) changes state ("Brown", "Blue" etc.") ...
315 views

How can this AbsoluteTime call be made faster?

I need to convert tons of date strings into absolute times. This generates an example data set of 10,000 strings: ...
230 views

How to skip weekends in DateListPlot?

How to skip weekends in DateListPlot, ie, drawing 20 something data points for a month and not leaving 2 days gap between weeks? Currently DateListPlot occupied the actual number of days for a month ...
249 views

Day of the week vs time on BoxWhiskerChart

I am completely stuck on how to approach this problem: I'm basically trying to figure out when is the best time to tweet on twitter, based on a list of timestamps: Here are the raw values: ...
372 views

Find all the last weekends in a year

In order to obtain the weekends of a year you'd use something like this: ...
203 views

Bug in DateListPlot in Mathematica 10

Mentioned this already in an answer to a related question. DateListPlot in Mathematica 10 has a horrible bug: If two points have the same time coordinate, only one is plotted; the others are ignored. ...
211 views

SetOptions for CoordinatesToolOptions for DateListPlot?

Bug introduced in 10.0 and persisting through 10.2.0 or later DateListPlot does not respect my Options setting for ...
94 views

DatePlus and DayPlus perform much worse than my user-defined-function

I was debugging a function speed, and discovered that the time bottleneck was in DatePlus. I tried to change to DayPlus and get ...
503 views

This code ...
546 views

Filter list based on date

What I would like to do is remove entries from a list of instrument data when it is in maintenance. The maintenance data I have is a series of dates which look like this; ...