Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
0answers
22 views

DateListPlot show point with a thin bar

I have a list of date points and I want to show each point with a single verticle line that connects the point with the x-axis. I imagine that the solution should be the same as for a ListPlot.
0
votes
0answers
22 views

DateList returns unexpected result

Why does DateList[{"2018W01", {"Year", "W", "Week"}}] return this {2018, 12, 31, 0, 0, 0.} By the way, it works in ...
1
vote
1answer
20 views

DateListPlot Didn't Display the Data [closed]

I'm trying to plot the data with DateListPlot function, but having some issues with the output. Here is what I'm doing. I'm downloading and parsing RAW JSON like this and extracting values section ...
0
votes
0answers
14 views

Interpreting date time string with milliseconds

I've noticed a discrepant behaviour between Interpreter and DateList when parsing dates: ...
1
vote
4answers
126 views

Compute “most-occuring weekdays” function

I am attempting to solve the Most-Occurring Weekdays in a Year challenge to teach myself Mathematica. Specifically, the challenge is: Write a function MostOccurringWeekday that takes an integer ...
0
votes
0answers
40 views

How can I count the number of days (Monday, Tues, etc) in a year?

I am new to Mathematica and for fun am trying some of the challenges. The one I am working on now is: ...
0
votes
1answer
52 views

Deriving a list of time differences from a column in a dataset and appending the list as a new column

I know it's a beginner question, but I've struggled with it for some time now and can't find a solution. I have a dataset consisting of timestamps, where I've managed to compute the time differences ...
3
votes
1answer
67 views

Retrieve File Dates for Files Inside an Archive (ZIP)

Suppose I have a zip archive file with many files in it. I can get a list of the files in the archive with: Import["zipfile.zip"] I can get data out of one of ...
47
votes
5answers
7k views

Mathematica command that allows it to read my intentions

In version 2.0 of Mathematica there was a command, ReadProgrammerIntentions[ ] which allowed it rapidly compose code that could solve problems simple to complex, ...
0
votes
1answer
57 views

How to visualize a series of time differences?

Question: Given a series of times how can we visualize the time between dates? Context I have data of the following structure: ...
9
votes
2answers
852 views

How to count occurrences of Friday 13th

I would like to find a function that will count the number of times Friday 13th happens in a particular calendar year. Does anybody have any hints ? Thank you
1
vote
1answer
26 views

Make DateTicks appear for every day and rotated in DateHistogram

Given the following code for plotting DateHistogram: ...
4
votes
2answers
97 views

Averaging a time series of amounts by week

I have a set of data with a list of dates (all Sundays in this case) and associated amounts. Most of these are every week, but some correspond to multiple weeks added together. I would like to average ...
1
vote
2answers
38 views

Import date and number Matrix Formatted as text

Hi I am new to Mathematica. I have a large text file that looks like: {"i":"2008-02-22","v":"9.102"},{"i":"2008-02-23","v":"11.14"},{"i":"2008-02-24","v":"12.21"}.....
3
votes
2answers
53 views

Extract time component from date in a dataset

I have a dataset of dates in the following format - Wed 18 Feb 1801 18:00. I want to extract only 18:00 from these dates i.e, the time component only. How do I go about doing so?
0
votes
1answer
47 views

Suppressing DateString default behavior when parts of date are missing

By subsampling data from a Excel spreadsheet I have created a Mathematica dataset that I then seek to modify by applying various functions to the fields to convert these data into a different flat ...
2
votes
0answers
42 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
74 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
65 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
124 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
505 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
38 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
84 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
71 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
56 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
104 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
55 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
132 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
74 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
95 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
42 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
78 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
23 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
94 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
86 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
87 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
463 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
154 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
83 views

Comparing DateObjects with sub-second differences

How can I properly compare DateObjects with differences less than a second? This ...
6
votes
1answer
171 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
32 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
91 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
75 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
62 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
78 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
106 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
187 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 ...