Questions about Mathematica's date and time functions.

learn more… | top users | synonyms (3)

26
votes
6answers
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 ...
45
votes
1answer
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 ...
13
votes
2answers
372 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. ...
23
votes
3answers
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!
12
votes
3answers
871 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 ...
9
votes
3answers
396 views

Faster Alternatives to DateDifference

I need a faster implementation of FractionOfYear and FractionOfMonth, which do the following: Input: A time/date specified by ...
6
votes
2answers
718 views

Finding the intersection of two date lists

I've got two lists that look like this ...
11
votes
3answers
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: ...
26
votes
4answers
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 ...
30
votes
2answers
2k 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 ...
14
votes
3answers
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 ...
14
votes
1answer
302 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 ...
10
votes
2answers
971 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 ...
5
votes
2answers
562 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 ...
2
votes
1answer
537 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]} ...
1
vote
0answers
89 views

Improving semantic interpretation of dates

SemanticInterpretation and Interpreter are promising but imperfect, eg extracting dates and calendar expressions from ...
8
votes
2answers
198 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 ...
13
votes
2answers
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, ...
8
votes
3answers
361 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.") ...
13
votes
2answers
404 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 ...
7
votes
2answers
390 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 ...
9
votes
1answer
286 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 ...
12
votes
5answers
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: ...
7
votes
4answers
537 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; ...
4
votes
2answers
104 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 ...
21
votes
3answers
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.
6
votes
5answers
417 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 ...
10
votes
1answer
242 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: ...
5
votes
1answer
190 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 ...
30
votes
1answer
791 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 ...
17
votes
10answers
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 ...
14
votes
5answers
490 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 ...
10
votes
1answer
221 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 ...
10
votes
1answer
677 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 ...
6
votes
2answers
148 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 ...
4
votes
1answer
366 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. ...
3
votes
0answers
70 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 ...
8
votes
3answers
481 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? ...
6
votes
1answer
723 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 ...
5
votes
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: ...
5
votes
2answers
172 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 ...
4
votes
1answer
134 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 ...
4
votes
2answers
365 views

Should we invest in Apple?

Ticker[comp_String] := Interpreter["Company"][comp] /. Entity[_, x_] :> x ticks = Ticker /@ {"Apple", "Google"} {"NASDAQ:AAPL", "NASDAQ:GOOGL"} ...
4
votes
2answers
718 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 ...
1
vote
1answer
75 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: ...
0
votes
2answers
146 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. ...
7
votes
3answers
227 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 ...
6
votes
2answers
874 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. ...
5
votes
4answers
214 views

DateListPlot: Highs and Lows

I have this data: ...
5
votes
3answers
276 views

Converting between AbsoluteTime and Unix time

By trial and error, I've found that the following gives the current Unix time: AbsoluteTime[] - UPOCH where UPOCH can be defined in any of the following ways: ...