[erlang-questions] add a time interval to a timestamp

Loris Fichera <>
Tue Mar 15 12:50:08 CET 2011


That's a great suggestion, will make things easier.
Thanks. :)

On 03/15/2011 12:22 PM, Harsh J wrote:
> Hello,
> 
> How about handling this with seconds since year 0?
> calendary:datetime_to_gregorian_seconds to get seconds, adding up this
> integer in seconds as you need and converting back to datetime with
> calendary:gregorian_seconds_to_datetime.
> 
> On Tue, Mar 15, 2011 at 4:24 PM, Loris Fichera <> wrote:
>> Hello everybody,
>>
>> Say I want to write a function that takes as input a timestamp (in the
>> form {{y,m,d}, {h,m,s}} ) and returns another timestamp, obtained by
>> adding a certain amount of {hours, minutes, seconds} to the input.
> 



More information about the erlang-questions mailing list