Questions tagged [date-and-time]

Questions about Mathematica's date and time functions.

Filter by
Sorted by
Tagged with
3 votes
3 answers
27 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,734
1 vote
2 answers
64 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
  • 341
0 votes
1 answer
72 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
66 views

Strange behavior of Gather with DateObject

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

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

Consider the following dummy data. ...
user13892's user avatar
  • 9,043
6 votes
2 answers
227 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,945
1 vote
1 answer
60 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
602 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
  • 1,937
6 votes
1 answer
340 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,043
1 vote
0 answers
46 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
238 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
51 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
53 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
66 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,525
4 votes
2 answers
143 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
48 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
68 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
  • 379
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,043
1 vote
0 answers
38 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
2 votes
2 answers
89 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
1 vote
1 answer
191 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
135 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
130 views

Select elements of a list based on membership in another list

I have two lists: ...
Luigi's user avatar
  • 1,271
6 votes
1 answer
138 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
  • 21.6k
2 votes
2 answers
55 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
0 votes
1 answer
70 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
90 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
157 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
  • 18.6k
1 vote
1 answer
191 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
53 views

Why is the DateInterval not handling disjoint periods correctly?

Consider the following as an example: ...
user13892's user avatar
  • 9,043
3 votes
1 answer
72 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,043
6 votes
1 answer
114 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
68 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
  • 790
2 votes
1 answer
123 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
  • 73
0 votes
1 answer
68 views

Adding observation to time series

I download three time series from FRED: ...
NC520's user avatar
  • 407
4 votes
2 answers
85 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,951
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
3 votes
1 answer
145 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,019
1 vote
2 answers
205 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
46 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,703
4 votes
2 answers
110 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
78 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
5 votes
2 answers
176 views

Marking day versus night in DateListPlot

I would like to mark the periods of day versus night on a DateListPlot (and associated plots) by light gray regions for the night. Here's a minimal example that ...
David G. Stork's user avatar
13 votes
9 answers
2k views

How to split a number

I have a number representing date (yyyymmdd): 19001231 I want to convert this number to {1900,12,31} How to do this? There ...
cheese.burger's user avatar
7 votes
3 answers
244 views

Tick marks for datelistplot

I have this data and I want to plot it with six dates on the x-axis. The first tick should be the first data points date minus two days and the last tick should be the last data points date plus two ...
Guy Fawkes's user avatar
1 vote
1 answer
92 views

a possible bug in IntervalUnion when applied to DateInterval

Bug introduced in 13.0 or earlier and persisting through 13.2.0 or later. It seems IntervalUnion may lead to unexpected results when applied to ...
sunt05's user avatar
  • 4,317
5 votes
2 answers
137 views

TimelinePlot, RotateLabel

Where am I going wrong with the following syntax? ...
martin's user avatar
  • 8,102
4 votes
3 answers
191 views

Finding the index of certain strings in a list

I'm actually using a dataset of much greater dimensions and length but I simplified my problem of string patterns in order to ask this question. ...
BBirdsell's user avatar
  • 1,156
11 votes
1 answer
314 views

Incorrect behavior of TimeObject in version 13

I used to use TimeObject in my code and pass it the string coming from a database system as follows and it used to convert it to the correct time. ...
user13892's user avatar
  • 9,043

1
2 3 4 5
11