Questions about Mathematica's date and time functions.

learn more… | top users | synonyms (1)

3
votes
4answers
235 views

Test whether date is in a certain period

I have one table which contains time periods ("start" and "end") and a "type" for every ...
3
votes
2answers
224 views

WeatherData for the 15th day of each month

Suppose we have WeatherData["Helsinki", "MeanTemperature", {{2007, 1, 1}, {2012, 12, 31}, "Day"}] How we can have data just for 15th day of each month?
2
votes
1answer
194 views

Importing data from Excel for DateListPlot

I am importing data from Excel and plotting it with DateListPlot. My code is ...
6
votes
6answers
583 views

Sort list by day names (Monday, Tuesday, etc)

I have some dates in a list, and I want to plot how many of those dates are Monday, Tuesday, etc. I'm using this: data = {...} Tally[DayOfWeek /@ data] and I ...
1
vote
4answers
154 views

Data format of Date including data

I have ...
19
votes
1answer
1k 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 ...
2
votes
1answer
161 views

ReadList importing negative times

This is probably an easy question to answer, but I need a fresh eye... I'm struggling with processing the following file (extract shown here) It's a list of dates, and positive/negative time durations ...
7
votes
2answers
261 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: ...
4
votes
2answers
368 views

Can Mathematica understand Excel dates when in number format?

I have a very large Excel file with dates in the format 2013/01/17 08:02:00 PM which is a custom date format. I have to convert this file to CSV in order to import it into Mathematica because I can't ...
6
votes
2answers
714 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. ...
3
votes
3answers
309 views

How to paint part of DateListPlot?

My graph is about fires (burned area) over 12 years presented in one Date List Log Plot. Because most of fires are in summer (as expected) I would like to highlight that with different background ...
7
votes
3answers
349 views

Find all the last weekends in a year

In order to obtain the weekends of a year you'd use something like this: ...
6
votes
5answers
370 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 ...
12
votes
5answers
1k 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: ...
1
vote
1answer
445 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]} ...
24
votes
3answers
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 ...
-1
votes
1answer
374 views

Importing Quicken Tab Delimited .*TXT File and plotting

I am using Mathematica 7 to try and plot my quicken data file. I have exported my quicken file as a .*TXT and have made zero changes to it. I want to do a ...
0
votes
1answer
126 views

Changing Datelist order

Im wondering how can I formulate a function which receives input in the string format "day.month.year hours: minutes: seconds" (for example, ...
3
votes
2answers
123 views

Is there a faster way to compute the endpoint for a DateRange given the start, step, and length?

Say I am given a date start an increment step (possibly mixed radix) and a desired number of steps ...
10
votes
1answer
203 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 ...
4
votes
2answers
134 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
203 views

Is DateString supposed to be truncating seconds?

If I configure DateString to format dates as ISO dates with ...
13
votes
4answers
384 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 ...
6
votes
2answers
613 views

Finding the intersection of two date lists

I've got two lists that look like this ...
29
votes
1answer
760 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 ...
13
votes
2answers
383 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 ...
14
votes
1answer
280 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 ...
2
votes
2answers
318 views

How do I generate a 3d histogram of runs

This question is an extension of the question I asked here Histogram of runs. What I would like to do now is generate a Histogram3D that has the run duration on the x axis and the mean level on the ...
2
votes
2answers
377 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; ...
4
votes
1answer
141 views

Strange behavior of DateList when converting string

DateList experiences some strange behavior which i cannot explain. This code works fine: ...
1
vote
1answer
128 views

Working of Date[]

Date[] returns the current date of local system, Date[1] returns {2012, 11, 15, 17, 41, 0.3161629}, ...
7
votes
4answers
480 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; ...
10
votes
2answers
285 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 ...
9
votes
1answer
260 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 ...
20
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.
12
votes
3answers
723 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 ...
10
votes
3answers
659 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 ...
6
votes
3answers
323 views

Importing and manipulating strings - time data

I have a list of time durations, which are strings of the form: "hh:mm:ss". Here's a sample for you to play with: ...
13
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 ...
6
votes
2answers
221 views

DateList Segmentation of data

I've been trying to separate large segments of DateList formatted data (years worth at a time) into individual days using the Split function. The data has the form: ...
5
votes
1answer
593 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 ...
1
vote
1answer
239 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: ...
11
votes
7answers
227 views

DateList coupled with String Operations

Through some webscraping, I have the following list: ...
7
votes
2answers
142 views

DatePlus and DateList are inconsistent with numerical handling of the final element

If you run this code you will see that DatePlus and DateList are inconsistent in the format of the lowest order element of the ...
10
votes
1answer
115 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. ...
5
votes
3answers
178 views

DateList's aggressive interpretation of TimeML duration codes

DateList "aggressively" interprets strings, such as "p72h": DateList["p72h"] gives ...
9
votes
1answer
410 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 ...
5
votes
2answers
468 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 ...
9
votes
3answers
350 views

Faster Alternatives to DateDifference

I need a faster implementation of FractionOfYear and FractionOfMonth, which do the following: Input: A time/date specified by ...
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 ...