Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [date-and-time]

Questions about Mathematica's date and time functions.

2
votes
0answers
35 views

How to get the events and holidays occurred on a list of dates?

I have a list of 100 unix timestamps and I am trying to get all the events occurred on that time. The following code get an abort signal when a has 100 timestamps. Another problem is that when I run ...
2
votes
1answer
28 views

DateObject ambiguous string interpretation?

I try to enter the following input, but receive an error message: DateObject["12/1/2016", DateFormat -> {"Month", "/", "Day", "/", "Year"}] despite having ...
-4
votes
2answers
51 views

How to calculate the age [duplicate]

How to calculate my age given date of birth? I have read other questions and answers but is not satisfied with answers. My question is how do I calculate my age if my date of birth is 18.03.2000?
-5
votes
1answer
69 views

How to calculate my age

How to calculate my age given my date of birth ? I have read other questions and answers but it is not satsified with the answers. My question is how do I calculate my current age if my birthdate is ...
17
votes
4answers
426 views

Reproducing the XKCD “Consensus New Year” plot

This xkcd strip for December 31, 2018 had the following plot: How may I use CountryData with DateListPlot (or other related ...
1
vote
1answer
35 views

Dynamic DateListPlot with multiple categories backed by DataSet

I have a DataSet that contains records with: an "activityName" string representing the kind of activity a "duration" value representing minutes a DateObject representing a date and time named "...
5
votes
1answer
77 views

Time stamps for In[] and Out[]

Once a command is entered and numbered, as in In[n], and an output is produced, as in Out[n], is it possible to find the time at which each one was done?
7
votes
1answer
51 views

Rounding datetime objects to a given granularity

How does one round datetime objects to any granularity (eg "Hour","Minute" etc)? What I'm looking for is a function that would do the following: ...
2
votes
0answers
38 views

Horrendously slow DateListPlot & Tooltip - causes, workarounds, fixes?

MMA 11.0.1.0 Win 10 64-bit i8700K The question is: how can one efficiently and speedily produce DateListPlots (or ListLinePlots with a date-time labelled x-axis calculated from x ordinates measure in ...
0
votes
2answers
64 views

Convert date to a number?

Is it possible to convert dates, like e.g. date = "2018-02-15"; to be represented by whole number increments starting with 30 December 1899, midnight UTC? I ...
2
votes
1answer
53 views

Convert time interval to mixed units without leading zeros

Let's say I have time intervals in seconds. I am looking for a method that produces the following conversions: 3660 => ...
6
votes
1answer
124 views

Include Images in Timeline Mathematica

I'd like to include an image in a timeline in mathematica. Is this possible using the TimelinePlot? There is this previous question which considers graphical ...
6
votes
2answers
68 views

How to edit DateObjects?

I have problems with removing time and time zone information from a date object. I found the same question here already, but my starting position is slightly different. My date objects are imported ...
9
votes
1answer
87 views

Dialog box that “times out” if the user doesn't respond

I want to ask the user (me) to make a binary choice, but also to give myself only 5 seconds in which to respond. In the absence of a response within 5 seconds, I want my code to close the dialog box ...
3
votes
1answer
29 views

TimeSeriesShift issue with TimeZone

I have to work with such a TimeZone to deal with daylight saving time. ...
6
votes
1answer
127 views

Does SolarEclipse only cover a limited date range?

If I use the example from the documentation for SolarEclipse and simply replace the years there with older ones, say from around Shakespeare's time, ...
2
votes
1answer
49 views

Convert list of strings into DateObjects

I have a list imported from a CSV: a = {{2018-07-0308-PM},{2018-07-0307-PM},{2018-07-0306-PM},{2018-07-0305-PM}} and want to convert these into a DateObject[]. ...
2
votes
1answer
21 views

How to show self-defined function on date in the “Appearance -> Labeled” of Manipulate?

I have a plot as below:- Manipulate[Plot[Sin[x*t/40000], {x, -6.6, 6.6}], {t, 30000, 40000, Appearance -> "Labeled"}] The t...
2
votes
1answer
75 views

How to show date format (yyyy/mm/dd) in ListPointPlot3D?

I have data1, whose first column is, in fact, the date (i.e. number of days from 1900/1/1). I then create a 3D plot as below:- ...
6
votes
2answers
76 views

Preparing large data sets for use with DateListPlot is extremely slow

Disclaimer: This is my first foray into Mathematica at the recommendation of a colleague. Any comments or recommendations in reference to idiomatic use, correct practices, etc. would be appreciated. ...
1
vote
1answer
69 views

compute a length excluding periodic segments [closed]

I have a range [start, end] and I need to compute its length excluding a periodic range defined by [offset, length, period] eg. ...
1
vote
1answer
67 views

Date range in DateListPlot

I am trying to plot the following figures but I cannot get the date range that I would like to have. I would like to have a date range like 1960,1970,1980....2020 ...
9
votes
5answers
444 views

Replicating a PlotStyle from Trees, Maps, and Theorems

How might I make a plot with this style, where the callouts are on the side and the y-axes chopped off for a minimal look? Here's some example data with the callout that I'd like to add, but I'm not ...
3
votes
2answers
147 views

Dates subtraction

I am interesting to calculate the time between a first event and last event. I calculate this in following way: The data looks as: ...
2
votes
0answers
66 views

Comparing DateObjects with sub-second differences

How can I properly compare DateObjects with differences less than a second? This ...
6
votes
1answer
163 views

How to convert dayname to number?

When I input DayName[{2012,12,24}] I get Monday as output. What is the most effective way to convert Monday into 1, Tuesday into ...
1
vote
0answers
31 views

How to export every n minutes?

I have a long simulation. I therefore want to export my results every N minutes. How can I do that ?
1
vote
2answers
75 views

Convert List of Dates Into Days Since a Certain Date

I have a list of dates in the form YYYY-MM-DD, where each element is not surrounded by quotations. How do I use Mathematica to convert that list of dates into a list of the number of days since a ...
22
votes
4answers
2k views

Are Easter days normally distributed?

How can Mathematica be used to check if Easter days are normally distributed? By definition, Easter day is the first Sunday after the first full moon after the spring equinox (so between March 23d ...
4
votes
0answers
67 views

ScheduledTask DateObject pattern to evaluate at same time everyday

I would like to create a ScheduledTask that evaluates at the same time everyday. Such as, evaluate function at 1:00 am everyday. The "Daily" timespec in ScheduledTask doesn't allow me to control the ...
2
votes
1answer
58 views

Make: Export[“msft-2018-01-01-to-today.csv”, FinancialData[“MSFT”, “Close”,“Jan. 1, 2018”]] export date column as date string “YYYY-MM-DD”

Here is an example: Export["~/EncryptedAlt3/src/trading/ivv-01012017-03252018.csv", FinancialData["NYSE:IVV", "Close", "Jan. 1, 2017"]] The file contents then ...
2
votes
3answers
74 views

How to make a new date-value list by reference to a date list

Here a base date list lstBase={"2018-03-01","2018-03-02","2018-03-03","2018-03-04","2018-03-07","2018-03-08","2018-03-11","2018-03-12","2018-03-13"}; and a date-...
1
vote
1answer
94 views

list of dates for vernal equinox

I'm trying to get a list of dates and times of the vernal equinox for the last 30 years (or some other time interval). I'm flailing about and really have gotten nowhere. When I've tried typing ...
6
votes
5answers
182 views

How to interpret a MM/DD string knowing that it lies on a day between two DD.MM.YYYY strings?

I am writing a parser for my banking statements. The structure of the document is a header that, among other things, contains the text Account statement from dd.mm.yyyy to dd.mm.yyyy and a table ...
4
votes
0answers
35 views

Preventing changes in TimeObject's TimeZone with subsequent operations

Is there an option or method to lock TimeZone in TimeObjects? For example, ...
1
vote
2answers
100 views

Is this intended behavior of MovingAverage on TimeSeries?

Suppose there is a uniformly spaced time series ts: ts = TimeSeries[{{{2015, 1}, a}, {{2015, 2}, b}, {{2015, 3}, c}, {{2015, 4}, d}, {{2015, 5}, e}}] The task ...
1
vote
2answers
63 views

Convert data types from string to list (Coastal Buoy data) for DateListPlot

I downloaded Coastal buoy data from the CDIP webpages and saved it as a text file. The trouble is that the data has spaces between the YYY MM DD hh mm. With ...
4
votes
1answer
52 views

Very Slow Accumulate of random time segments

Even for short list (15 elem) of random time segments of DateObjects, Accumulate consumes unexpectedly long times. But, when time segments are not random, or are ...
10
votes
1answer
193 views

Different behaviour of `DateRange` between 11.2 and 11.3

Bug introduced in 11.3 CASE:4028568 ...
0
votes
1answer
30 views

Changing list of different time units to same

My function currently outputs differencies between dates and gives a list as an output. However in the output some of the times are in hours and some in days but this causes problems to further ...
1
vote
2answers
67 views

Need help creating a BarChart

I have a log-file which lists a time and date I logged in on one website. I want to create a BarChart which compares the amount of times I did it every day. How to ...
0
votes
1answer
73 views

How can I change the time zone used in DateListPlot?

I have some data which are key value pairs of Unix timestamp to integer. I parse them into a list of { date object, integer } pairs like so: ...
3
votes
1answer
46 views

How to programmatically determine information about a DateObject

(This question was inspired by my off-target answer to the question How to get the size of a DateObject?). The answer was not obvious to me, so I think a question/answer for this would be useful) How ...
0
votes
2answers
34 views

DateHistogram horizontal axis labels and bin size

Problem I'm tracking some DateObject data and I'm struggling to get the horizontal axis ticks to match the time in Pacific Standard Time (PST). Data ...
4
votes
3answers
206 views

How to get the size of a DateObject?

DateObjects can be of varying physical dimensions. CurrentDate[Today, #] & /@ {"Day", "Month", "Year"} How do you get ...
2
votes
1answer
100 views

Selecting a range of dates from a database

I am new to Mathematica and I would like to select data from a database using dates as criteria. In this moment I am working on the ResourceData["New Orleans Slave Sales 1856-1861"] from the Wolfram ...
1
vote
1answer
74 views

Import and export datetime object

I have a list of datetime objects and numbers, say When I export to a txt file, it gives {DateObject[{2017, 1, 1, 0, 0}, "Minute", "Gregorian", 0., {"ISODateTime"}], 0} {DateObject[{2017, 1, ...
3
votes
0answers
38 views

Missing values vanish from expressions with DateObject and slot-lookup?

Missing value vanishes when adding or subtracting DateObject but only when slot-lookup is used, in an Association query: Given ...
1
vote
1answer
43 views

What is the correct way of DateListPlot-ting multiple data sets at once?

In Mathematica 10.1 I could do the following: ...
2
votes
1answer
55 views