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

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 ...
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. ...
917 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 ...
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!
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 <...
729 views

Finding the intersection of two date lists

I've got two lists that look like this ...
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: ...
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 ...
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 ...
311 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 ...
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 ...
578 views

From a list of dates, get a list of the last date available in each month

I wondered if anyone has another or even a more direct way of finding the last dates of each month available from a list of successive dates? I currently do the following (note: nothing special about ...
550 views

Converting Excel serial dates with NETLink

Excel serial dates are not straightforward to convert since they include non-existent dates, e.g. {DatePlus[{1990, 1, 0}, 59], DatePlus[{1990, 1, 0}, 60]} {{...
94 views

Improving semantic interpretation of dates

SemanticInterpretation and Interpreter are promising but imperfect, eg extracting dates and calendar expressions from semi-...
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 ...
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

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....
381 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.") ...
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 ...
432 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 ...
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 ...
139 views

How to restart a Clock

The code below is to demonstrate color afterimages. The user chooses a color, fixates the changing number at the center until it reach 30 (seconds), then manually switches to white to observer the ...
547 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; ...
114 views

Make a time IntervalSlider

I want to make a time interval slider with an initial setting of (10:00:00 Mar. 8 2015, 12:30:00 Mar. 8 2015) and which varies from 00:00:00 Mar. 8 2015 to 22:30:00 Mar. 8 2015 with a granularity of ...
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.
426 views

Handling holidays in financial time series

I have two lists: list1and list2, which are financial time series with only 2 variables—date and price. The problem is: these ...
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: ...
217 views

Problems with TimelinePlot

I'm trying to play with the example in this recent blog post, but I'm having a few basic issues with TimelinePlot: Labels are getting cut off: How can I get ...
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 ...
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 ...
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 ...
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 ... 1answer 698 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 ... 4answers 229 views Getting AbsoluteTiming to display in hours, minutes, and seconds I'm doing some extended length calculations and was wondering how I could get AbsoluteTiming to display in hours, minutes, and seconds. I googled and found nothing, ... 2answers 151 views How to speed up Min of DateObjects? I'm in version 10.0.1 using a Dataset to do some plots and things. For one of the plots I need to get the minimum date of a some filtered set of the ... 1answer 378 views BarChart that lines up with dates in DateListPlot I am trying to create a chart similar to the view offered by TradingChart, but with custom data not relating to finance. ... 0answers 71 views How can I set up a cell style that is ascending dates? [closed] Outline style notebooks have cell counters that are simply ascending numbers, but what if I want to apply a function to them and have descending dates like this: So that they auto format and the ... 3answers 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? ... 1answer 741 views Simple countdown timer in Mathematica I dug around a bit and did not find a simple and clear implementation of countdown stopwatch in Mathematica. I am looking for a function that takes as an input a certain integer and then counts down ... 1answer 66 views DateObject for current date skips a day when crossing the date line with TimeZone The DateObject was introduced in version 10 of Mathematica. One can call it to fetch the current local date and time: ... 2answers 179 views Is it safe to change the value of$TimeZone?

I'd like to configure some of my notebooks to assume all calculations using dates, times and locations (notably AstronomicalData , but others too) take place at the ...
374 views

Should we invest in Apple?

Ticker[comp_String] := Interpreter["Company"][comp] /. Entity[_, x_] :> x ticks = Ticker /@ {"Apple", "Google"} {"NASDAQ:AAPL", "NASDAQ:GOOGL"} ...
730 views

FrameTicks and GridLines in DateListPlot

I would like to know what is the best way to configure one GridLine for the hour in LightGray and another for the days in ...
79 views

Why does TimeSeriesShift is just adding a fixed number of days?

I'd like to shift all contents of a TimeSeries object by one month. By shifting Feb. 1st I would expect to receive Mar. 1st. However it's not the case for Mathematica: ...
150 views

How to partition three years of data into daily samples

I'm trying to find mean of temperature data list. The temperature data list has 3 hours steps which means I have 365*8=2920 temperature measurements per year. My data are temperatures of 13 years. ...
229 views

Different results with DateRange and LeapYearsQ in Mathematica 9 and 10

With Mathematica 9.0 for Mac OS X x86 (64-bit) (January 24, 2013) one could use DateRange[{2000}, {2010}, "Year"] to achive ...
892 views

Select elements of list within a date range

I have a list which consists of elements each of which has a date in DateList format, a number and a flag (Y/N). e.g. ...