Questions about Mathematica's date and time functions.

learn more… | top users | synonyms (1)

23
votes
6answers
958 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 ...
34
votes
1answer
557 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 ...
11
votes
3answers
478 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 ...
5
votes
2answers
453 views

Finding the intersection of two date lists

I've got two lists that look like this ...
8
votes
3answers
280 views

Faster Alternatives to DateDifference

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

From a list of dates get a list of the last date available in a 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 ...
12
votes
1answer
215 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 ...
12
votes
2answers
342 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 ...
4
votes
1answer
201 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 ...
1
vote
1answer
256 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]} ...
10
votes
5answers
656 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: ...
17
votes
1answer
852 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 ...
11
votes
2answers
789 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 ...
23
votes
0answers
519 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 ...
6
votes
5answers
306 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
421 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 ...
9
votes
1answer
171 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 ...
9
votes
1answer
223 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 ...
4
votes
1answer
432 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 ...
2
votes
1answer
82 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 ...
7
votes
3answers
360 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; ...
2
votes
2answers
311 views

Histogram of runs

What I would like to do is generate a histogram of the consecutive time spent under a level. For example if the level I was interested in was 1.0 and I had this data; ...
1
vote
1answer
206 views

How can Time be made to go backwards?

I would like to make a countdown timer, but cannot find a reliable method to make the DateList[] function reverse. The not so robust code for the Digital Clock with the display of seconds follows: ...