A period of time is an interval, a span of time. You can also use it for questions related to the actual punctuation mark.
Questions tagged [period]
508 questions
95
votes
3 answers
What does 'PT' prefix stand for in Duration?
I am trying to use the Duration class instead of long.
It has superior literal syntax. I like its flexibility, though it looks weird.
"PT10S" means 10 seconds, what is the problem to accept "10 seconds"?!
Okay never mind.
I am just curious why PT…

Daniil Iaitskov
- 5,525
- 8
- 39
- 49
80
votes
5 answers
Using a variable period in an interval in Postgres
I have a relation that maintains monthly historical data. This data is added to the table on the last day of each month. A service I am writing can then be called specifying a month and a number of months prior for which to retrieve the historical…

Belizzle
- 1,295
- 3
- 13
- 28
57
votes
4 answers
Period to string
I'm using the Joda-Time library with Java. I'm having some difficulty trying to turn a Period object to a string in the format of "x days, x hours, x minutes".
These Period objects are first created by adding an amount of seconds to them (they are…
tt
56
votes
5 answers
Generate a list of datetimes between an interval
Given two datetimes (start_date and end_date), I'd like to generate a list of other datetimes between these two dates, the new datetimes being separated by a variable interval. e.g. every 4 days between 2011-10-10 and 2011-12-12 or every 8 hours…

Joucks
- 1,302
- 1
- 17
- 29
47
votes
4 answers
Run a function periodically in Scala
I want to call an arbitrary function every n seconds. Basically I want something identical to SetInterval from Javascript. How can I achieve this in Scala?

src091
- 2,807
- 7
- 44
- 74
31
votes
2 answers
Fast Fourier Transform in R
I have a dataset with the number of hourly visits an animal made during a period of 12 months. I want to use the Fast Fourier Transform to examine cyclical patterns and periodicity. In the past, I have used Statistica for this this; however, I would…

user1626688
- 1,583
- 4
- 18
- 27
23
votes
4 answers
How to format a Period in Java 8 / jsr310?
I'd like to format a Period using a pattern like YY years, MM months, DD days. The utilities in Java 8 are designed to format time but neither period, nor duration. There's a PeriodFormatter in Joda time. Does Java have similar utilities?

naXa stands with Ukraine
- 35,493
- 19
- 190
- 259
18
votes
3 answers
How to handle full period in java.time?
The Period class in java.time handles only the date-oriented potion: years, months, days.
What about the time portion: hours, minutes, seconds?
How can we parse and generate string representations of full periods as defined in ISO 8601,…

Basil Bourque
- 303,325
- 100
- 852
- 1,154
17
votes
3 answers
Clean way to convert quarterly periods to datetime in pandas
EDIT:
If you're coming to this question and your string looks like 1996-Q1, then just use pd.to_datetime(df['Quarter']) to convert it to a proper pandas datetime. This question is about solving all the quarter dates that are not in this standard…

Sander van den Oord
- 10,986
- 5
- 51
- 96
16
votes
3 answers
How to convert ISO 8601 period to a string readable by humans [Android Studio]?
Any suggestions on how to convert the ISO 8601 duration format PnYnMnDTnHnMnS (ex: P1W, P5D, P3D) to number of days?
I'm trying to set the text of a button in a way that the days of free trial are displayed to the user.
Google provides the billing…

someAndroidDevProbably
- 163
- 1
- 8
15
votes
1 answer
What is the meaning of ". filename" (period space filename) in Bash?
What does a command with format [period][space][filename] mean?
Example:
. ./setup.sh
Also in the .bashrc file, we have a line like that:
. "$HOME/.bashrc"
What does this mean?

Muhammad Raihan Muhaimin
- 5,559
- 7
- 47
- 68
14
votes
6 answers
Working with an array with periods in key values
I'm getting data from an array. For some reason the array has key values like [3.3] which I'm having trouble retrieving data from.
I have this array [3.3] => First Name [3.6] => Last Name[2] => email@example.com.
When I try to call $array[3.3] it…

Brooke.
- 3,691
- 13
- 49
- 80
14
votes
2 answers
ASP.NET MVC: How to Route Search Term with . (Period) at the end
I get a 404 response from .Net MVC when I try to make a request where my search term ends with a . (period). This is the route that I'm using:
routes.MapRoute(
"Json",
"Remote.mvc/{action}/{searchTerm}/{count}",
…
Will
12
votes
3 answers
What does the 'period' character (.) mean if used in the middle of a PHP string?
Here is some example code:
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
What does the period character do in the middle of each piece of the string?
For…

mhz
- 1,019
- 2
- 8
- 30
11
votes
2 answers
Java - Elegant way of parsing date/period?
From the ISO-8601 standards, there are 4 ways of expressing intervals/duration:
Start and end, such as "2007-03-01T13:00:00Z/2008-05-11T15:30:00Z"
Start and duration, such as "2007-03-01T13:00:00Z/P1Y2M10DT2H30M"
Duration and end, such as…

aphrid
- 589
- 8
- 25