Questions tagged [date-and-time]

Questions about Mathematica's date and time functions.

Filter by
Sorted by
Tagged with
6
votes
1answer
58 views

Datasets and Time Values: Filtering and Plotting

After struggling for a few weeks, I have accumulated a few examples of challenging date-related operatations with datasets. Some I have partial solutions; others I cannot yet do. The resources on ...
3
votes
0answers
52 views

Does mathematica has a date region function together with operations like intersection?

Consider the following scenario. Suppose I consider time range from TimeObject[{18,30,0}] to TimeObject[{22,30,0}] on Weekdays ...
5
votes
1answer
90 views

Show timing of every output

I know I can follow Wolfram's guide and enable "ShowTiming" to show the timing of the previous command at the bottom of the window. Additionally, I can enable <...
1
vote
1answer
37 views

Applying Function to Ambiguous Dates in a Dataset

I have a large Dataset with a few columns that contain ambiguous date strings in a variety of formats. I am wanting to reformat these so they are all the same. ...
1
vote
1answer
27 views

Plotting a Histogram3D with time (a file per frame) as parameter?

I've been working for a few days trying to make a dynamic histogram on Mathematica, but I can't seem to make it happen. You see, I'm fairly new to working with Mathematica and thus lack some knowledge ...
1
vote
0answers
44 views

Prospective StartOfTime and EndOfTime in Mathematica

When working with conditions for numbers we have a notion of \[Infinity] representing larger than any other number and similarly ...
4
votes
1answer
58 views

Converting Daily Time Series Data into Low Frequency Data (Weekly, Bi-weekly, Monthly,..)

I have daily time series example data as follows: ...
4
votes
0answers
52 views

Built-in function (or terse method) to convert from DateObject to Python datetime in Python?

When using the Wolfram Client Library for Python in a Python program there appears to be no built-in function to convert a DateObject in to a Python ...
0
votes
0answers
25 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
23 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
26 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
15 views

Interpreting date time string with milliseconds

I've noticed a discrepant behaviour between Interpreter and DateList when parsing dates: ...
1
vote
4answers
130 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
42 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
54 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
68 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
8k 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
63 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
857 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
30 views

Make DateTicks appear for every day and rotated in DateHistogram

Given the following code for plotting DateHistogram: ...
4
votes
2answers
102 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
39 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
55 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
49 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
43 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
99 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
69 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
126 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
524 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
87 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
84 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
60 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
135 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
57 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
137 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
77 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
98 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
95 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
24 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
95 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
93 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
98 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
468 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
157 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
88 views

Comparing DateObjects with sub-second differences

How can I properly compare DateObjects with differences less than a second? This ...
7
votes
2answers
210 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 ...