Jump to content
Sign in to follow this  
sigil

is there a script for addition and subtraction of time?

Recommended Posts

I need to add and subtract minutes from a given time in military time format (e.g., 8:45 p.m. is 2045).

Let's say the function header looks like this:

func timeAdd($time,$minutes)

then timeAdd(2239,27) would return 2306.

Is there a script already out there for this? I couldn't find one in the scripts section, but perhaps I wasn't using the correct keyword to search for one.

Share this post


Link to post
Share on other sites

I need to add and subtract minutes from a given time in military time format (e.g., 8:45 p.m. is 2045).

Let's say the function header looks like this:

func timeAdd($time,$minutes)

then timeAdd(2239,27) would return 2306.

Is there a script already out there for this? I couldn't find one in the scripts section, but perhaps I wasn't using the correct keyword to search for one.

_dateAdd() will work when the the input is put in the correct format... :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...