Questions tagged [date-and-time]

Questions about Mathematica's date and time functions.

Filter by
Sorted by
Tagged with
4 votes
2 answers
176 views

DayPlus seems to not work consistently with dates given as a DateObject

Counting days and coming up with reliable date calculations is rather essential in legal and financial applications. Unfortunately, it seems that DayPlus does not ...
gwr's user avatar
  • 13.4k
0 votes
0 answers
33 views

DateListPlot and PlotLegends make FrameTicks disappear

I am using Mma12.0 ($Version gives "12.0.0 for Microsoft Windows (64-bit)"). Consider the procedures below: Open a new notebook. Type this code and run: <...
Harry's user avatar
  • 2,715
4 votes
2 answers
185 views

Highlight a time range in a DateListPlot

I want to do a datelistplot with a temporal data, and then i want to highlight in the plot an interval of data between two dates. the highlight i want to do is put a rectangle behind the plot. I tried ...
Renato QE's user avatar
1 vote
2 answers
140 views

How to output the current date and time of a particular country?

When you run Date, it outputs information about the date and time set on my computer. Date[] If I modify them, the output results will also be different. How to ...
Milk's user avatar
  • 1,658
7 votes
2 answers
223 views

How can I round a TimeObject according to a certain interval

I have a TimeObject for 06:52:24, and I'd like to round it to the nearest 15 minutes (in this case 07:00). Is this possible to do in general? I know how to do it ...
Adar Maori's user avatar
1 vote
1 answer
28 views

DateFormat textstring

The appearance of a DateObject can be controlled by DateFormat, e.g. "Language". Is it possible to extract the text string so that in Style it appears the same as normal text.
Hans W's user avatar
  • 73
4 votes
2 answers
146 views

DateSelect : columnwise selection applied to a matrix

Let consider : A time interval (January given by Time) A random set of values (Minimal example values given by Val) as ...
Jocelyn Minini's user avatar
4 votes
3 answers
144 views

Cases syntax when expression sought is a Quantity

From the following list I wish to extract those cases for which the magnitude of a quantity is greater than zero for which I would like to then create a DateListPlot. ...
Stuart Poss's user avatar
  • 1,883
1 vote
2 answers
82 views

How to format TimeObject with 12-hour AM/PM format?

Interpreter["Time"] does the opposite of what I want, convert a date or time in AM/PM format to 24-hour, but is there any way to display ...
user6552's user avatar
  • 363
0 votes
1 answer
87 views

How to take a satellite image in Mathematica at different times?

I want to see the satellite image of the same area at different times. But by entering the following code, also shows the same picture with changing times. ...
Erfan's user avatar
  • 159
1 vote
1 answer
68 views

Strange behavior of Gather with DateObject

Using 13.3 I encountered the following. ...
Whelp's user avatar
  • 1,705
7 votes
1 answer
151 views

How to adjust PlotHighlighting of version 13.3 to use custom labeling function?

Consider the following dummy data. ...
user13892's user avatar
  • 9,313
6 votes
2 answers
286 views

Create Datetime and add milliseconds

I want to create a datetime with milliseconds in the form: "2023.07.22 12:34:56.123"; To which I can add a certain amount of milliseconds (e.g. with the <...
holistic's user avatar
  • 2,975
1 vote
1 answer
73 views

Interpolation of date-time data to fill in missing data for data sources with different time resolution

I have 2 data sources with different data acquisition rates. My first data source is a temperature measurement over time with a resolution of 1 s. My second source ...
BesselFunct's user avatar
9 votes
4 answers
629 views

Check if a string is a date

I have a list of strings, {"BD4675365", "Corp", "Managers", "Syndicate", "2021-03-08", "8434926"} and I ...
apg's user avatar
  • 2,037
6 votes
1 answer
342 views

Shouldn't Infinite Past be smaller than all other dates?

Max of Infinite past and a finite time gives Infinite past. Max[DateObject[{-\[Infinity],1,1},"Day"],DateObject[{2023,7,1},"Day"]] DateObject[{...
user13892's user avatar
  • 9,313
1 vote
0 answers
47 views

Printout precision [closed]

For debugging, I print out the SessionTime. In the Notebook it looks like: ...
Aharon Naiman's user avatar
5 votes
4 answers
242 views

Working directly on DateObjects

This relates to an earlier question I asked some years ago, From a list of dates, get a list of the last date available in each month. In this case, I have a list of business dates (no weekends or ...
Jagra's user avatar
  • 14.3k
2 votes
1 answer
53 views

Multiplication counting to illustrate HornerForm

HornerForm[] converts a polynomial with integer exponents into an equivalent polynomial that requires fewer total multiplications. (It also has the benefit of ...
David G. Stork's user avatar
3 votes
1 answer
66 views

Export and Import DateObjects

I have a number of long lists of DateObjects paired with values. An example data element looks like this: It takes several hours of processing time to generate ...
Jagra's user avatar
  • 14.3k
1 vote
1 answer
87 views

Adding error bars on x axis in DateListPlot

Is it possible to add error bars in the x direction in a DateListPlot? It seems that a naive application of Around in this case ...
mattiav27's user avatar
  • 6,637
4 votes
2 answers
165 views

Pair monthly data with daily data

I need to pair 30-year treasury yield data (only available monthly) to S&P500 data of the same dates. Treasury data WolframAlpha accesses from the St. Louis Federal Reserve comes down with dates ...
Jagra's user avatar
  • 14.3k
0 votes
0 answers
49 views

Force time series to drop the date part and keep only the time one

Mathematica's TimeSeries takes as an input the values and the time. If I have a TimeObject with timestamps (without the date, ...
Stelios's user avatar
  • 56
1 vote
1 answer
82 views

Coloring Points in a DateListPlot

I want to plot a time series so that positive values appear in red and negative values in green. I have tried all kind of variants of the following, which just plots everything in the last color ...
MMAUser's user avatar
  • 399
1 vote
1 answer
72 views

How to change the background color of DateObject?

Recently I encountered a situation where I would like to distinguish between different DateObjects for a visual appearance for presentation. For now, I am using <...
user13892's user avatar
  • 9,313
1 vote
0 answers
41 views

DateFormat for ISO8601 string with TimeZone?

What is the DateFormat to convert ISO8601 string with timezone to DateObject? For exmaple, ...
alancalvitti's user avatar
  • 15.1k
2 votes
2 answers
97 views

Holiday names from HolidayCalendar?

HolidayCalendar doc outputs aholiday dates as DateObject list based on a date range. Is there a method or Entity to map to names,...
alancalvitti's user avatar
  • 15.1k
1 vote
1 answer
196 views

Is there any hope to get the result faster if we use a supercomputer for the given problem?

If an operation in Mathematica (say, computing the determinant of a $88\times88$ parametric matrix) takes much time to be computed on a personal computer (core i7), say a week, then, is there any hope ...
charmin's user avatar
  • 1,159
0 votes
2 answers
137 views

Solving a system of equations takes too long [closed]

I was trying to solve a system of 4 equations with Mathematica but it took too long (running for hours) without any output. I have tried many ways without any success. I need your help. Thank you in ...
ridha's user avatar
  • 21
3 votes
3 answers
138 views

Select elements of a list based on membership in another list

I have two lists: ...
Luigi's user avatar
  • 1,281
6 votes
1 answer
145 views

How can I tell the WL auto-magic date interpreter to use a day-first interpretation if there is ambiguity?

I know you can use DateObject[{"05-08-2022", {"Day", "Month", "Year" }}] to tell WL the date format explicitly, but a rigid ...
Sjoerd Smit's user avatar
  • 23.1k
2 votes
2 answers
57 views

DayMatchQ Alternative day name specification

Not clear from DayMatchQ doc page but doesn't seem to work for say alternatives the way MatchQ does, eg ...
alancalvitti's user avatar
  • 15.1k
0 votes
1 answer
73 views

List structure for plotting multiple y-values (with gaps on certain dates) using DateListPlot

I would like to set up a list like this data = {{Date1,y1,y2,y3,y4,y5,y6},{Date2,y1,y2,y3,y4,y5,y6},...} and then use DateListPlot to create various plots, e.g. y1 ...
ConfusedCabbage's user avatar
5 votes
1 answer
105 views

Reduce granularity and remove options from a DateObject

I have a DateObject with lots of granularity and additional specifications, such as the following e.g.: ...
IntroductionToProbability's user avatar
0 votes
0 answers
56 views

Can I use Timeseries of a Data to plot the ARCHProcess?

So, I have a list s={Timeseries1,Timeseries2,Timeseris3} I want to Plot a graph just like :Mathematica I tried to do this but I didn't understand some parts of the ...
amalsebastian7's user avatar
7 votes
2 answers
176 views

What's the reverse of DateValue[..., "YearExact"]?

DateValue[..., "YearExact"] can be used to get a date as an non-integer year. This can be useful for some quick, not necessarily too precise calculations ...
kirma's user avatar
  • 19k
1 vote
1 answer
208 views

AbsoluteTime::ambig: Warning: the interpretation of the string 11-12-2020 as a date is ambiguous

TScci30clean = TimeSeries[cci30clean[[2 ;;]]] I dont understand why this shows an error ,i have changed the date format twice in excel sheet that im working on ...
amalsebastian7's user avatar
0 votes
0 answers
54 views

Why is the DateInterval not handling disjoint periods correctly?

Consider the following as an example: ...
user13892's user avatar
  • 9,313
3 votes
1 answer
75 views

How do I import a file only when it is modified?

I am trying to create a Dynamic code that will Import the contents of file only if it has been modified. I tried the following ...
user13892's user avatar
  • 9,313
6 votes
1 answer
122 views

Changing callout sizes in TimelinePlot

I have a large, complex TimelinePlot in which the callout bubbles are too large, as shown here: I'm happy with the font size and layout, but the bounding panes should be reduced (vertically) by a ...
David G. Stork's user avatar
1 vote
1 answer
75 views

Federal Reserve Interest Rate Data has years with differing number of weeks

I need to compute annual mean interest rates from public data. FRED mortgage rate data (available here: https://fred.stlouisfed.org/series/MORTGAGE30US) when downloaded as an Excel file, Imports as ...
Rogo's user avatar
  • 830
3 votes
1 answer
133 views

How to import CSV file with mixed data, including string Mathematica expressions and numbers

I am importing a CSV file that looks like this (Extract of data as viewed in Notepad): ...
Richard's user avatar
  • 93
0 votes
1 answer
75 views

Adding observation to time series

I download three time series from FRED: ...
NC520's user avatar
  • 417
4 votes
2 answers
89 views

Format Time Reported by AbsoluteTiming

I am trying to format the timing reported by AbsoluteTiming so that it states the hours minutes and seconds of the result. However, probably because ...
Nicholas G's user avatar
  • 1,961
0 votes
0 answers
44 views

DateFormat to display DateObject sub-second data?

Is there a DateFormat or other option to display milliseconds? DateObject["2022-04-18T14:02:10.326"] Sub-second ...
alancalvitti's user avatar
  • 15.1k
3 votes
1 answer
146 views

Changing weekend definition

How to change the definition of 'Weekend' to get 'True' from every Friday from 22:00:01 to Sunday 23:00:00. Example: ...
ralph's user avatar
  • 1,029
1 vote
2 answers
302 views

Convert clock time to seconds [duplicate]

I have a long list with time values in the format Hours:minutes:Seconds. How can I convert the time back to seconds? For example (for seconds it also have a decimal fraction) ...
erez's user avatar
  • 297
1 vote
1 answer
47 views

`DateList` hour format

I cannot find it in the documentation, what is the default form of hour in the DateList when the form {y,m,d,h,m,s} is used. I ...
atapaka's user avatar
  • 3,874
4 votes
2 answers
111 views

DateHistogram with DateReduction -> editing x axis

I have a list of dates spanning over multiple years (i.e.): ...
user85559's user avatar
0 votes
2 answers
80 views

DateListPlot if condition is fulfilled

This must be very simple but I could not find an appropriate answer. I have imported a huge .xlsx file with three columns: country name, date and a value and I would like to DateListPlot the values ...
Beny Spira's user avatar

1
2 3 4 5
11