• Support
  • Articles
  • Resources
  • Products

Math with Dates

Moderator: boris

2 postsPage 1 of 1

IshmaelCallMe
Guru

Posts:
675
Joined: Thu Jan 26, 2006 2:28 am
by IshmaelCallMe » Tue Apr 15, 2008 9:16 pm
These subroutines convert a date and time into the number of seconds since 2003 and back. You can then add or subtract seconds and then convert back. This way, even if the time conversion goes across dates or the midnight or noon boundary, it will still be correct.
Trevor
Guru

Posts:
485
Joined: Wed Jul 26, 2006 8:47 am
by Trevor » Thu Nov 14, 2013 1:58 pm
If you need to deal with epoch times then to get seconds as a standard unix epoch time (seconds since 1st Jan1970 00:00:00) in timeconv change this line:
to this:

The conversion the other way (convtime) from date string to seconds would also need adjusting but I haven't yet needed to do this , will post again if I do make this adjustment for convtime also.

Regards
Trevor
Display posts from previous:
Sort by:

2 postsPage 1 of 1

Users browsing this forum: No registered users
cron