Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [date-and-time]

Questions about Mathematica's date and time functions.

Filter by
Sorted by
Tagged with
-5
votes
1answer
131 views

How to calculate my age [closed]

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 ...
20
votes
4answers
549 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
43 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 "...
6
votes
1answer
91 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
112 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: ...
3
votes
0answers
70 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
214 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
58 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
141 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
80 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 ...
10
votes
1answer
111 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
45 views

TimeSeriesShift issue with TimeZone

I have to work with such a TimeZone to deal with daylight saving time. ...
6
votes
1answer
131 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
133 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
25 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
104 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
106 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
119 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 ...
8
votes
1answer
227 views

Is there a way to obtain the time when an input was executed in a notebook?

I have a notebook with lots of In[n] in my current session. The notebook has been open for over three days. I would like to get the timestamps for when certain old ...
9
votes
5answers
481 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
163 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
90 views

Comparing DateObjects with sub-second differences

How can I properly compare DateObjects with differences less than a second? This ...
7
votes
2answers
228 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
34 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
114 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
79 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
64 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
81 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
117 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
189 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
40 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
114 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
94 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. {Edit 4/5/2019: Updated link Please see ...
4
votes
1answer
61 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
204 views

Different behaviour of `DateRange` between 11.2 and 11.3

Bug introduced in 11.3 and fixed in 12.0. CASE:4028568 ...
0
votes
1answer
33 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
79 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
91 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: ...
5
votes
1answer
54 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
48 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
215 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
230 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 ...
1
vote
1answer
105 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
41 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
60 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
61 views

Why does the presence of a non-numeric range value shift labeling of a DateListPlot?

Consider the following code: ...
0
votes
0answers
37 views

store `CalendarData` locally in a file and load it to a computer without internet

How to download the CalendarData indices and locally store them in a file for the computer (server) where the internet connection is not available. To run command ...
2
votes
1answer
145 views

FrameTicks Problem in DateListPlot

(I have MMA 10.0.2.0 running on a MacBook Pro with OS X 10.12.6.) Before posting this question I looked at a number of interesting and helpful related posts: Is FrameTicks broken in 10.1.0?, How to ...